/* Friendly — shared design tokens (landing + admin + chart).
   Pastel palette, Nunito/Quicksand, rounded, WCAG 2.2 AA-compliant contrast. */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Quicksand:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

:root {
  --mint: #C8F0DC;
  --mint-deep: #7DD3A8;
  --peach: #FFD8C2;
  --peach-deep: #FFAB7E;
  --peach-darker: #FF8E5C;
  --lavender: #E0D4F7;
  --lavender-deep: #B89EED;
  --butter: #FFF1B8;
  --butter-deep: #FFD966;
  --sky: #C8E4F7;
  --sky-deep: #7BB8E8;
  --cream: #FFF8F2;
  --soft-white: #FFFCF8;
  --text: #3D3556;
  --text-soft: #6B5F84;
  --text-muted: #9B92B0;
  --border: #E9DCEF;
  --shadow-soft: 0 8px 24px rgba(184, 158, 237, 0.12);
  --shadow-warm: 0 12px 32px rgba(255, 171, 126, 0.18);
  --shadow-mint: 0 12px 32px rgba(125, 211, 168, 0.20);
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 32px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Quicksand', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  font-weight: 500;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  letter-spacing: -0.4px;
  font-weight: 800;
  margin-top: 0;
}
h1 { font-size: 2.4rem; line-height: 1.1; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.05rem; }

a { color: var(--peach-darker); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--lavender); outline-offset: 3px; border-radius: 6px; }

.fr-mono { font-family: 'Quicksand', monospace; letter-spacing: 0.3px; }
.text-muted { color: var(--text-muted) !important; }

/* Brand bar / top nav (admin-style) */
.fr-brand-bar {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255, 248, 242, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid rgba(224, 212, 247, 0.45);
  padding: 16px 0;
  margin-bottom: 32px;
}
.fr-brand-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.fr-brand-logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 18px; font-weight: 800; color: var(--text);
  text-decoration: none !important;
}
.fr-brand-logo:hover { text-decoration: none !important; }
.fr-brand-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--mint-deep), var(--sky-deep));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-mint); color: white;
}
.fr-brand-title { margin: 0; font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -0.4px; }
.fr-brand-sub { margin: 0; font-size: 12px; font-weight: 700; color: var(--peach-darker); letter-spacing: 0.3px; }

.fr-nav {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  list-style: none; padding: 0; margin: 0;
}
.fr-nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 14px;
  color: var(--text-soft); font-weight: 700; font-size: 14px;
  text-decoration: none; border: none;
  transition: all 0.2s ease;
}
.fr-nav-link:hover { background: var(--mint); color: var(--text); text-decoration: none; }
.fr-nav-link.active { background: var(--lavender); color: var(--text); }

.fr-nav-user {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: white;
  border-radius: 100px; border: 2px solid var(--lavender);
  font-weight: 700; font-size: 13px; color: var(--text);
}

/* Container */
.fr-container { max-width: 1600px; margin: 0 auto; padding: 0 28px; }

/* Buttons (override Bootstrap) */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 16px;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 14.5px;
  text-decoration: none; border: none; cursor: pointer;
  transition: all 0.25s ease; white-space: nowrap;
  line-height: 1;
}
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 18px; }
.btn:focus-visible { outline: 3px solid var(--lavender); outline-offset: 2px; }

.btn-primary, .btn-primary:focus {
  background: linear-gradient(135deg, var(--peach-deep), var(--peach-darker));
  color: white; box-shadow: var(--shadow-warm); border: none;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(255, 142, 92, 0.32); color: white; }

.btn-secondary, .btn-secondary:focus {
  background: white; color: var(--text);
  border: 2px solid var(--lavender); box-shadow: var(--shadow-soft);
}
.btn-secondary:hover { background: var(--lavender); transform: translateY(-2px); color: var(--text); }

.btn-outline-primary, .btn-outline-primary:focus {
  background: transparent; color: var(--text);
  border: 2px solid var(--lavender); box-shadow: none;
}
.btn-outline-primary:hover, .btn-outline-primary.active {
  background: var(--lavender); color: var(--text); transform: translateY(-1px);
}

.btn-outline-secondary, .btn-outline-secondary:focus {
  background: transparent; color: var(--text-soft);
  border: 2px solid var(--border);
}
.btn-outline-secondary:hover { background: var(--cream); color: var(--text); border-color: var(--lavender); }

.btn-danger { background: #F87171; color: white; border: none; }
.btn-danger:hover { background: #EF4444; color: white; }

.btn-success {
  background: linear-gradient(135deg, var(--mint-deep), #4BB685);
  color: white; border: none; box-shadow: var(--shadow-mint);
}
.btn-success:hover { transform: translateY(-2px); color: white; }

/* Cards */
.fr-card {
  background: white; border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow-soft); border: 2px solid transparent;
  margin-bottom: 24px;
}
.fr-card-soft {
  background: var(--peach); border: 2px solid rgba(255, 171, 126, 0.4);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-soft);
}
.fr-card-soft.secondary { background: var(--mint); border-color: rgba(125, 211, 168, 0.4); }
.fr-card-soft.sky { background: var(--sky); border-color: rgba(123, 184, 232, 0.4); }
.fr-card-soft.lavender { background: var(--lavender); border-color: rgba(184, 158, 237, 0.4); }

/* Stats tiles */
.fr-stat {
  background: white; border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow-soft); border: 2px solid transparent;
  display: flex; flex-direction: column; gap: 6px;
  transition: all 0.2s ease;
}
.fr-stat:hover { transform: translateY(-2px); border-color: var(--lavender); }
.fr-stat .value { font-size: 2.2rem; font-weight: 900; color: var(--text); letter-spacing: -1px; line-height: 1; font-family: 'Nunito', sans-serif; }
.fr-stat .label { font-size: 12px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.fr-stat.accent-mint .value { color: var(--mint-deep); }
.fr-stat.accent-peach .value { color: var(--peach-darker); }
.fr-stat.accent-lavender .value { color: var(--lavender-deep); }
.fr-stat.accent-sky .value { color: var(--sky-deep); }

/* Forms */
.form-control, .form-select {
  font-family: inherit; font-weight: 500; font-size: 15px;
  padding: 12px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: all 0.2s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--lavender-deep);
  box-shadow: 0 0 0 4px rgba(184, 158, 237, 0.2);
  outline: none;
}
.form-label { font-weight: 700; color: var(--text); font-size: 14px; margin-bottom: 6px; }
.form-text { font-size: 12px; color: var(--text-muted); }

/* Tables */
.table {
  background: white; border-collapse: separate; border-spacing: 0;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-soft); width: 100%;
  margin-bottom: 0;
}
.table thead th {
  background: var(--lavender); color: var(--text);
  font-weight: 800; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 14px 18px; border: none;
}
.table tbody td {
  padding: 14px 18px; border: none; border-top: 1px solid var(--border);
  font-size: 14.5px; color: var(--text);
}
.table tbody tr:first-child td { border-top: none; }
.table tbody tr:hover td { background: var(--cream); }

/* Badges */
.fr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 100px;
  font-size: 11.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  font-family: 'Nunito', sans-serif;
}
.fr-badge-auto      { background: var(--mint);     color: #2F7B5A; }
.fr-badge-manual    { background: var(--sky);      color: #2C6F99; }
.fr-badge-ambiguous { background: var(--butter);   color: #876900; }
.fr-badge-unmatched { background: #FEE2E2;         color: #B91C1C; }
.fr-badge-ignored   { background: var(--border);   color: var(--text-soft); }

/* Amounts */
.fr-amount { font-family: 'Quicksand', monospace; font-weight: 700; }
.fr-amount-positive { color: var(--mint-deep); }
.fr-amount-negative { color: #EF4444; }

/* Alerts */
.alert {
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  padding: 14px 20px;
  font-weight: 600;
}
.alert-success { background: var(--mint); color: #2F7B5A; border-color: rgba(125, 211, 168, 0.5); }
.alert-danger  { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; }
.alert-info    { background: var(--sky); color: #2C6F99; border-color: rgba(123, 184, 232, 0.5); }
.alert-warning { background: var(--butter); color: #876900; border-color: rgba(255, 217, 102, 0.5); }

/* Chart wrapper */
.fr-chart-wrap {
  background: white; border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-soft);
  border: 2px solid var(--border);
}

/* Login/auth surface */
.fr-auth-card {
  background: white; border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow-soft);
  border: 2px solid transparent;
  max-width: 420px; margin: 48px auto;
  position: relative;
}
.fr-auth-card::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 140px; height: 140px; background: var(--butter);
  border-radius: 50%; opacity: 0.45; filter: blur(20px); z-index: 0;
}
.fr-auth-card > * { position: relative; z-index: 1; }

/* Utility */
.fr-page-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.fr-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }

.fr-footer {
  text-align: center; padding: 32px 0 24px;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
}

/* Confirm button on review rows */
.fr-confirm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--mint); color: #2F7B5A;
  border: 2px solid var(--mint-deep); border-radius: 100px;
  font-family: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer; transition: all 0.15s ease;
}
.fr-confirm:hover { background: var(--mint-deep); color: white; transform: translateY(-1px); }
.fr-confirm-name { font-weight: 800; font-size: 13px; color: var(--text); display: block; margin-top: 2px; }
.fr-confirm-meta { font-size: 11px; color: var(--text-muted); font-family: 'Quicksand', monospace; margin-top: 1px; }

/* Class card with action button */
.fr-class-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.fr-class-card-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fr-class-code { font-size: 1.6rem; font-weight: 900; color: var(--text); letter-spacing: -0.8px; }
.fr-class-size { font-weight: 700; color: var(--text-soft); font-size: 13px; }
.fr-class-msg-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 100px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,0.75); color: var(--text); text-decoration: none;
  border: 1px solid rgba(0,0,0,0.04); transition: all 0.2s ease;
}
.fr-class-msg-btn:hover { background: white; transform: translateY(-1px); box-shadow: var(--shadow-soft); color: var(--peach-deep); }
.fr-class-clicks {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--text-soft);
  background: rgba(255,255,255,0.6); padding: 4px 10px; border-radius: 100px;
  align-self: flex-start;
}
.fr-class-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fr-copy-link-btn {
  background: rgba(255,255,255,0.75); border: 1px solid rgba(0,0,0,0.04);
  cursor: pointer; font-family: inherit;
}

/* Summary tile (monthly zestawienie, reusable) */
.fr-stat-label {
  font-size: 11px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.fr-stat-value {
  font-size: 1.6rem; font-weight: 900; color: var(--text);
  font-family: 'Quicksand', monospace; margin-top: 4px; line-height: 1.1;
}

/* Class switcher pills (message generator) */
.fr-class-switch {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin: 0 0 16px; box-shadow: var(--shadow-soft);
}
.fr-class-switch-label {
  font-size: 11px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px; margin-right: 6px;
}
.fr-class-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 6px 12px; border-radius: 100px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  color: var(--text-soft); background: var(--cream);
  border: 1.5px solid transparent; transition: all 0.15s ease;
}
.fr-class-pill:hover { background: var(--lavender); color: var(--text); }
.fr-class-pill.active {
  background: var(--peach-deep); color: white;
  border-color: var(--peach-deep); box-shadow: var(--shadow-warm);
}

.fr-tpl-hint {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 500;
  color: var(--text-muted); text-transform: none; letter-spacing: 0;
}
.fr-class-token-hint {
  display: inline-block; margin-left: 6px; font-family: 'Quicksand', monospace;
  font-size: 11px; color: var(--text-muted);
  background: var(--cream); padding: 1px 8px; border-radius: 8px;
}
.fr-tpl-hint code {
  background: var(--butter); color: #876900; padding: 1px 6px; border-radius: 6px;
  font-family: 'Quicksand', monospace; font-size: 11px; font-weight: 700;
}

.fr-preview-class-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; padding: 4px 14px; border-radius: 14px;
  background: linear-gradient(135deg, var(--mint-deep), var(--sky-deep));
  color: white; font-size: 1.35rem; font-weight: 900; letter-spacing: -0.5px;
  box-shadow: var(--shadow-mint);
}

/* Message preview (class message generator) */
.fr-message-preview {
  background: var(--cream); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 18px 22px; font-family: 'Quicksand', 'Nunito', sans-serif;
  font-size: 14px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap; word-wrap: break-word;
  min-height: 420px; margin: 0;
}

/* Review filter form (month + search) */
.fr-review-filters {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin: 0 0 18px; box-shadow: var(--shadow-soft);
}
.fr-review-filter-group { display: flex; flex-direction: column; gap: 4px; }
.fr-review-filter-group label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.fr-review-filter-group select { min-width: 140px; }
.fr-review-search { flex: 1; min-width: 220px; }
.fr-review-search-wrap { position: relative; }
.fr-review-search-wrap i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.fr-review-search-wrap input { padding-left: 34px; }

/* Responsive */
@media (max-width: 768px) {
  .fr-brand-row { flex-direction: column; align-items: flex-start; }
  .fr-nav { width: 100%; }
  .fr-card { padding: 22px; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }
}
