/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg:         #f5f0e8;
  --surface:    #ffffff;
  --border:     #e8e0d5;
  --dark:       #2c3e50;
  --mid:        #5d6d7e;
  --muted:      #95a5a6;
  --shadow:     0 1px 4px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --radius:     6px;
  --radius-lg:  10px;

  --gold:       #8b6914;  --gold-bg:    #f8f4ee;
  --blue:       #2c5282;  --blue-bg:    #ebf4ff;
  --red:        #742a2a;  --red-bg:     #fff5f5;
  --green:      #22543d;  --green-bg:   #f0fff4;

  --success:    #27ae60;
  --danger:     #c0392b;
  --warning:    #d68910;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: #333;
  min-height: 100vh;
}

/* ── App Header ─────────────────────────────────────────────────────────── */
.app-header {
  background: var(--dark);
  padding: 0 32px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.app-header-title {
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: normal;
  color: #ecf0f1;
  letter-spacing: 0.3px;
}

.app-header-title small {
  color: var(--muted);
  font-size: 12px;
  margin-left: 10px;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 28px 64px;
}

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  padding: 9px 22px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: var(--mid);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color 0.15s, background 0.15s;
}
.tab-btn:hover  { color: var(--dark); background: rgba(0,0,0,0.03); }
.tab-btn.active { color: var(--dark); border-bottom-color: var(--dark); font-weight: 600; }

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.card-header h2 {
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: normal;
  color: var(--dark);
  letter-spacing: 0.2px;
}

.card-body { padding: 20px 24px; }

/* ── Toast Notification ─────────────────────────────────────────────────── */
.notification {
  position: fixed;
  top: 64px;
  right: 24px;
  max-width: 400px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  transition: opacity 0.25s, transform 0.25s;
}
.notification.hidden   { opacity: 0; pointer-events: none; transform: translateY(-6px); }
.notification.success  { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.notification.error    { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 11px;
  color: var(--mid);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: #333;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  min-width: 0;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--dark);
  box-shadow: 0 0 0 3px rgba(44,62,80,0.09);
}
textarea { height: 80px; resize: vertical; min-width: 280px; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-row label { font-size: 13px; color: var(--mid); display: flex; align-items: center; gap: 8px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  transition: filter 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn:hover { filter: brightness(0.92); }

.btn-primary   { background: var(--dark); color: #fff; }
.btn-secondary { background: #7f8c8d; color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-gold      { background: var(--gold); color: #fff; }
.btn-ghost     { background: transparent; color: var(--mid); border: 1px solid var(--border); }
.btn-sm        { padding: 5px 10px; font-size: 12px; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  text-align: left;
  padding: 9px 14px;
  background: #faf8f5;
  color: var(--mid);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: #333;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #faf8f5; }

.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.empty-row td { text-align: center; padding: 28px; color: var(--muted); font-size: 13px; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-muted   { background: #ecf0f1; color: var(--mid); }
.badge-sent    { background: #d4edda; color: #155724; }
.badge-unsent  { background: #ecf0f1; color: var(--mid); }

/* ── Group Detail Panel ─────────────────────────────────────────────────── */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-group-name {
  font-family: Georgia, serif;
  font-size: 20px;
  color: var(--dark);
  font-weight: normal;
  margin-bottom: 8px;
}

.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 22px 0 10px;
}
.section-label:first-child { margin-top: 0; }

/* ── Intention Block ────────────────────────────────────────────────────── */
.intention-block {
  background: #f8f9fa;
  border-radius: var(--radius);
  border-left: 4px solid var(--mid);
  padding: 14px 18px;
}
.intention-block .i-title {
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--dark);
  font-weight: bold;
  margin-bottom: 4px;
}
.intention-block .i-content {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.7;
}
.intention-missing {
  background: #fff3cd;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: #856404;
}

/* ── Mystery Grid ───────────────────────────────────────────────────────── */
.mystery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.mystery-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mystery-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.mc-top {
  padding: 7px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.mc-num { font-size: 11px; font-weight: 700; color: var(--muted); }
.mc-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

.mc-image {
  aspect-ratio: 2 / 1;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mc-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mc-image-placeholder { font-size: 22px; color: var(--border); }

.mc-body { padding: 9px 11px; }
.mc-name { font-size: 12px; font-weight: 600; color: var(--dark); line-height: 1.4; margin-bottom: 5px; }
.mc-user {
  font-size: 12px;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 5px;
}
.mc-user::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

/* Category colour themes */
.cat-radosne   .mc-top { background: var(--gold-bg); }
.cat-radosne   .mc-cat { color: var(--gold); }
.cat-radosne   .mc-user::before { background: var(--gold); }

.cat-swiatla   .mc-top { background: var(--blue-bg); }
.cat-swiatla   .mc-cat { color: var(--blue); }
.cat-swiatla   .mc-user::before { background: var(--blue); }

.cat-bolesne   .mc-top { background: var(--red-bg); }
.cat-bolesne   .mc-cat { color: var(--red); }
.cat-bolesne   .mc-user::before { background: var(--red); }

.cat-chwalebne .mc-top { background: var(--green-bg); }
.cat-chwalebne .mc-cat { color: var(--green); }
.cat-chwalebne .mc-user::before { background: var(--green); }

/* ── Login Page ─────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 40px;
  width: 360px;
  text-align: center;
}
.login-logo { font-size: 28px; margin-bottom: 12px; color: var(--dark); }
.login-card h1 {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: normal;
  color: var(--dark);
  margin-bottom: 4px;
}
.login-card .subtitle { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.login-card .form-group { text-align: left; margin-bottom: 14px; }
.login-card .form-group input { width: 100%; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.login-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: left;
}

/* ── Utilities ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted   { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.empty-state  { text-align: center; padding: 28px 16px; color: var(--muted); font-size: 13px; }
.divider      { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.mt-4         { margin-top: 16px; }

/* ── Public Page Base ───────────────────────────────────────────────────────── */
.public-page { background: var(--bg); }

.public-header {
  background: var(--dark);
  padding: 0 32px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.public-logo {
  font-family: Georgia, serif;
  font-size: 15px;
  color: #ecf0f1;
  letter-spacing: 0.3px;
  font-weight: normal;
}

/* ── Hero Section ───────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #2c3e50 0%, #3d566e 100%);
  padding: 80px 24px 90px;
  text-align: center;
}

.hero-inner { max-width: 600px; margin: 0 auto; }

.hero-cross {
  font-size: 36px;
  color: rgba(240,235,227,0.6);
  margin-bottom: 18px;
}

.hero-title {
  font-family: Georgia, serif;
  font-size: clamp(26px, 5vw, 38px);
  color: #f0ebe3;
  font-weight: normal;
  line-height: 1.3;
  margin: 0 0 14px;
}

.hero-subtitle {
  font-size: 16px;
  color: #95a5a6;
  line-height: 1.7;
  margin: 0 0 32px;
}

.hero-btn {
  padding: 12px 32px;
  font-size: 15px;
  background: #f0ebe3;
  color: var(--dark);
  border-radius: 4px;
}
.hero-btn:hover { filter: brightness(0.94); }

/* ── Landing Main ───────────────────────────────────────────────────────────── */
.landing-main { max-width: 860px; margin: 0 auto; padding: 0 24px 64px; }

.landing-section { padding: 52px 0; }
.landing-section-inner { max-width: 720px; margin: 0 auto; }

.section-icon { font-size: 28px; margin-bottom: 14px; }

.landing-h2 {
  font-family: Georgia, serif;
  font-size: 24px;
  color: var(--dark);
  font-weight: normal;
  margin: 0 0 18px;
}

.landing-lead {
  font-size: 16px;
  color: #444;
  line-height: 1.8;
  margin: 0 0 16px;
}

.landing-text {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.8;
  margin: 0;
}

.landing-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* Mystery overview grid */
.mysteries-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.mystery-type {
  border-radius: var(--radius);
  padding: 12px 14px;
  border-left: 3px solid;
}
.mystery-type-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
}
.mystery-type-desc { font-size: 12px; color: var(--mid); line-height: 1.5; }

.cat-radosne-card   { background: var(--gold-bg);  border-color: var(--gold);  }
.cat-radosne-card   .mystery-type-label { color: var(--gold); }
.cat-swiatla-card   { background: var(--blue-bg);  border-color: var(--blue);  }
.cat-swiatla-card   .mystery-type-label { color: var(--blue); }
.cat-bolesne-card   { background: var(--red-bg);   border-color: var(--red);   }
.cat-bolesne-card   .mystery-type-label { color: var(--red); }
.cat-chwalebne-card { background: var(--green-bg); border-color: var(--green); }
.cat-chwalebne-card .mystery-type-label { color: var(--green); }

/* Highlight box */
.highlight-box {
  background: #f8f9fa;
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--mid);
  line-height: 1.8;
}
.highlight-box p { margin: 0; }

/* Steps list */
.steps-list { margin: 24px 0 0; display: flex; flex-direction: column; gap: 16px; }

.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

.step-body { font-size: 14px; color: #444; line-height: 1.7; }
.step-body strong { color: var(--dark); display: block; margin-bottom: 3px; }
.step-body p { margin: 0; }

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.feature-icon { font-size: 22px; margin-bottom: 10px; }
.feature-card h3 { font-family: Georgia, serif; font-size: 14px; font-weight: normal; color: var(--dark); margin: 0 0 8px; }
.feature-card p  { font-size: 13px; color: var(--mid); line-height: 1.7; margin: 0; }

/* CTA Section */
.cta-section {
  background: var(--dark);
  border-radius: var(--radius-lg);
  margin: 16px 0 0;
  padding: 52px 24px;
  text-align: center;
}

.cta-inner { max-width: 500px; margin: 0 auto; }
.cta-cross  { font-size: 28px; color: rgba(240,235,227,0.5); margin-bottom: 16px; }
.cta-title  { font-family: Georgia, serif; font-size: 22px; font-weight: normal; color: #f0ebe3; margin: 0 0 12px; }
.cta-text   { font-size: 14px; color: #95a5a6; line-height: 1.8; margin: 0 0 24px; }
.cta-btn    { padding: 11px 28px; font-size: 14px; background: #f0ebe3; color: var(--dark); }
.cta-btn:hover { filter: brightness(0.94); }

/* ── Public Footer ──────────────────────────────────────────────────────────── */
.public-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-style: italic;
  font-family: Georgia, serif;
}

/* ── Signup Page ────────────────────────────────────────────────────────────── */
.signup-main {
  min-height: calc(100vh - 52px - 65px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
}

.signup-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 40px;
  width: 100%;
  max-width: 500px;
}

.signup-card-header {
  text-align: center;
  margin-bottom: 28px;
}

.signup-logo { font-size: 28px; color: var(--dark); margin-bottom: 12px; }

.signup-card h1 {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: normal;
  color: var(--dark);
  margin: 0 0 6px;
}

.signup-card .subtitle { font-size: 13px; color: var(--muted); margin: 0; }

.signup-card .form-group { margin-bottom: 16px; }
.signup-card .form-group input,
.signup-card .form-group select,
.signup-card .form-group textarea { width: 100%; }

.required { color: var(--danger); }
.optional  { font-size: 10px; color: var(--muted); font-weight: normal; text-transform: none; letter-spacing: 0; }

.field-note {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 0;
}

.signup-success {
  text-align: center;
  padding: 16px 0;
}

.success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  font-size: 22px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.signup-success h2 {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: normal;
  color: var(--dark);
  margin: 0 0 10px;
}

.signup-success p { font-size: 14px; color: var(--mid); line-height: 1.7; margin: 0; }

/* ── Approve Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 440px;
  margin: 0;
}

/* ── Signup Request Status Badges ───────────────────────────────────────────── */
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
