/* Funnky Bunnky Rewarding System — shared design tokens (docs/PRODUCT_REQUIREMENTS.md §2) */
:root {
  --fb-sky: #9CD1F9;
  --fb-pink: #FD9FB1;
  --fb-yellow: #FFDE05;
  --fb-white: #FFFFFF;
  --fb-navy: #262B73;

  --fb-bg: #F5FAFF;
  --fb-card: #FFFFFF;
  --fb-text: #23264A;
  --fb-muted: #6b7290;
  --fb-radius-lg: 22px;
  --fb-radius-md: 14px;
  --fb-radius-sm: 8px;
  --fb-shadow: 0 8px 24px rgba(38, 43, 115, 0.08);
  --fb-success: #38b06a;
  --fb-danger: #e2536b;
  --fb-warning: #d99a1b;
}

[data-theme="dark"] {
  --fb-bg: #14162b;
  --fb-card: #1d2040;
  --fb-text: #eef0ff;
  --fb-muted: #a2a6cf;
  --fb-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body.fb-body {
  margin: 0;
  font-family: 'Tahoma', 'Segoe UI', system-ui, sans-serif;
  background: var(--fb-bg);
  color: var(--fb-text);
  direction: rtl;
  line-height: 1.6;
}

.fb-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.fb-container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.fb-card {
  background: var(--fb-card);
  border-radius: var(--fb-radius-lg);
  box-shadow: var(--fb-shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.fb-logo {
  display: block;
  max-width: 160px;
  margin: 0 auto 12px;
}

.fb-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--fb-navy);
  margin: 0 0 4px;
}
[data-theme="dark"] .fb-title { color: var(--fb-sky); }

.fb-tagline {
  text-align: center;
  color: var(--fb-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--fb-radius-md);
  border: none;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  min-height: 52px;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.fb-btn:active { transform: scale(0.98); }
.fb-btn-primary { background: var(--fb-navy); color: var(--fb-white); }
.fb-btn-pink { background: var(--fb-pink); color: var(--fb-navy); }
.fb-btn-yellow { background: var(--fb-yellow); color: var(--fb-navy); }
.fb-btn-outline { background: transparent; border: 2px solid var(--fb-navy); color: var(--fb-navy); }
[data-theme="dark"] .fb-btn-outline { border-color: var(--fb-sky); color: var(--fb-sky); }
.fb-btn-danger { background: var(--fb-danger); color: var(--fb-white); }
.fb-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fb-btn-sm { padding: 10px 14px; min-height: 40px; font-size: 14px; width: auto; }

.fb-field { margin-bottom: 16px; }
.fb-label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.fb-input, .fb-select, .fb-textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--fb-radius-md);
  border: 2px solid #dfe7f5;
  font-size: 16px;
  background: var(--fb-card);
  color: var(--fb-text);
}
[data-theme="dark"] .fb-input, [data-theme="dark"] .fb-select, [data-theme="dark"] .fb-textarea { border-color: #33376a; }
.fb-input:focus, .fb-select:focus, .fb-textarea:focus { outline: none; border-color: var(--fb-sky); }
.fb-hint { font-size: 12px; color: var(--fb-muted); margin-top: 4px; }
.fb-error { color: var(--fb-danger); font-size: 13px; margin-top: 4px; font-weight: 700; }

.fb-progress-wrap { background: #e9eefc; border-radius: 999px; height: 22px; overflow: hidden; }
[data-theme="dark"] .fb-progress-wrap { background: #2a2e57; }
.fb-progress-bar { height: 100%; background: linear-gradient(90deg, var(--fb-sky), var(--fb-pink)); border-radius: 999px; transition: width 0.4s ease; }

.fb-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.fb-badge-pending { background: #fff3cd; color: #8a6d1a; }
.fb-badge-approved { background: #d7f4e2; color: #1f7a45; }
.fb-badge-rejected { background: #fbdde3; color: #a3324a; }
.fb-badge-expired { background: #e6e6ee; color: #55597a; }
.fb-badge-cancelled { background: #e6e6ee; color: #55597a; }

.fb-child-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-child-name { font-weight: 800; font-size: 18px; color: var(--fb-navy); }
[data-theme="dark"] .fb-child-name { color: var(--fb-sky); }

.fb-emoji-lg { font-size: 34px; }

.fb-nav-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.fb-nav-tab { flex: 0 0 auto; padding: 10px 16px; border-radius: 999px; background: var(--fb-card); color: var(--fb-text); text-decoration: none; font-weight: 700; font-size: 14px; box-shadow: var(--fb-shadow); }
.fb-nav-tab.active { background: var(--fb-navy); color: var(--fb-white); }

.fb-bottom-nav { position: sticky; bottom: 0; display: flex; background: var(--fb-card); box-shadow: 0 -4px 12px rgba(0,0,0,0.08); border-radius: 20px 20px 0 0; padding: 8px; margin-top: 20px; }
.fb-bottom-nav a { flex: 1; text-align: center; text-decoration: none; color: var(--fb-muted); font-size: 12px; padding: 8px 0; font-weight: 700; }
.fb-bottom-nav a.active { color: var(--fb-navy); }
[data-theme="dark"] .fb-bottom-nav a.active { color: var(--fb-sky); }

/* Staff dashboard */
.fb-staff-shell { display: flex; min-height: 100vh; }
.fb-sidebar { width: 220px; background: var(--fb-navy); color: var(--fb-white); flex-shrink: 0; padding: 20px 12px; }
.fb-sidebar a { display: block; color: #d7e3fb; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 4px; }
.fb-sidebar a.active, .fb-sidebar a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.fb-main { flex: 1; padding: 20px; min-width: 0; }
.fb-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }

.fb-table { width: 100%; border-collapse: collapse; background: var(--fb-card); border-radius: var(--fb-radius-md); overflow: hidden; }
.fb-table th, .fb-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid #eef1fa; font-size: 14px; }
[data-theme="dark"] .fb-table th, [data-theme="dark"] .fb-table td { border-color: #2a2e57; }
.fb-table th { background: #eef3fd; font-weight: 800; }
[data-theme="dark"] .fb-table th { background: #262a52; }

.fb-table-responsive { overflow-x: auto; }

@media (max-width: 860px) {
  .fb-staff-shell { flex-direction: column; }
  .fb-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px; }
  .fb-sidebar a { white-space: nowrap; margin-left: 4px; margin-bottom: 0; }
  .fb-table thead { display: none; }
  .fb-table, .fb-table tbody, .fb-table tr, .fb-table td { display: block; width: 100%; }
  .fb-table tr { margin-bottom: 12px; border-radius: var(--fb-radius-md); box-shadow: var(--fb-shadow); overflow: hidden; }
  .fb-table td { border-bottom: 1px solid #eef1fa; display: flex; justify-content: space-between; gap: 10px; }
  .fb-table td::before { content: attr(data-label); font-weight: 700; color: var(--fb-muted); }
}

.fb-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.fb-stat-tile { background: var(--fb-card); border-radius: var(--fb-radius-md); box-shadow: var(--fb-shadow); padding: 16px; }
.fb-stat-tile .num { font-size: 28px; font-weight: 800; color: var(--fb-navy); }
[data-theme="dark"] .fb-stat-tile .num { color: var(--fb-sky); }
.fb-stat-tile .label { color: var(--fb-muted); font-size: 13px; }

.fb-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.fb-link { color: var(--fb-navy); font-weight: 700; }
[data-theme="dark"] .fb-link { color: var(--fb-sky); }

.fb-theme-toggle { background: none; border: 2px solid var(--fb-navy); color: var(--fb-navy); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 700; }
[data-theme="dark"] .fb-theme-toggle { border-color: var(--fb-sky); color: var(--fb-sky); }
