/*
Theme Name: Khashoggi Family
Theme URI: https://khashoggi.family
Author: Khashoggi Family
Author URI: https://khashoggi.family
Description: قالب عائلة خاشقجي — موقع تراثي عصري بشجرة عائلة تفاعلية ذكية، محلل علاقات، رؤى عائلية، أمان متعدد الطبقات، ولوحة تحكم كاملة. A heritage-modern family portal with interactive family tree, relationship analyzer, family insights, layered security, and full admin panel.
Version: 2.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: khashoggi-family
Tags: rtl-language-support, full-width-template, custom-colors, custom-logo, translation-ready, arabic
*/

/* =========================================================
   KHASHOGGI FAMILY — Heritage Theme v2
   A warm, manuscript-inspired, mobile-first design system.
   ========================================================= */

:root {
  /* Ink & parchment — heritage palette */
  --ink-deep: #0b0c1c;
  --ink-900:  #11132a;
  --ink-800:  #171a35;
  --ink-700:  #1d2143;
  --ink-600:  #262b52;
  --ink-card: rgba(23, 26, 53, 0.65);

  --parchment:     #f3e9d2;
  --parchment-dim: #c9bda1;
  --cream:         #e8dfc3;

  --gold-900:   #6b4d1c;
  --gold-800:   #8c6b2e;
  --gold-700:   #a8843e;
  --gold:       #c9a059;
  --gold-bright:#e6c07d;
  --gold-glow:  #ffd98a;

  --burgundy:   #8b2e3c;
  --burgundy-d: #6b1f2c;
  --sage:       #6a8a63;
  --night:      #1e2a4a;

  --male:   #7aa8e0;
  --female: #e69fb8;
  --match:  #ffe28a;
  --danger: #e37373;
  --success:#8fd0a6;

  --line:       rgba(201, 160, 89, 0.28);
  --line-soft:  rgba(201, 160, 89, 0.12);
  --glass:      rgba(255, 255, 255, 0.06);
  --glass-line: rgba(255, 255, 255, 0.1);

  --shadow-sm: 0 2px 14px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 34px rgba(0,0,0,0.45);
  --shadow-lg: 0 28px 80px rgba(0,0,0,0.55), 0 0 60px rgba(201,160,89,0.08);

  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --header-h:   72px;
}

@media (max-width: 720px) {
  :root { --header-h: 62px; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: rgba(230, 192, 125, 0.4); color: #fff; }

html, body {
  background: var(--ink-deep);
  color: var(--parchment);
  font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  direction: rtl;
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body { min-height: 100vh; position: relative; }

/* =========================================================
   BACKGROUND — aged manuscript glow layers
   ========================================================= */
body::before {
  content: '';
  position: fixed;
  inset: -10%;
  background:
    radial-gradient(ellipse 40% 35% at 85% 10%, rgba(230, 192, 125, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 35% 30% at 15% 25%, rgba(139, 46, 60, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(106, 138, 99, 0.10) 0%, transparent 55%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: kf-breathe 18s ease-in-out infinite alternate;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.85 0 0 0 0 0.75 0 0 0 0 0.5 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}
@keyframes kf-breathe {
  0%,100% { transform: scale(1) rotate(0); }
  50%     { transform: scale(1.08) rotate(6deg); }
}

/* Every major surface sits above the ambient layers */
.kf-site-header, .kf-site-footer, main, .kf-hero, .kf-section, .kf-login-page { position: relative; z-index: 1; }

a { color: var(--gold-bright); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-glow); }

.kf-container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* =========================================================
   DECORATIVE ORNAMENTS (used throughout for heritage feel)
   ========================================================= */
.kf-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--gold);
  margin: 12px 0;
  font-size: 14px;
}
.kf-ornament::before, .kf-ornament::after {
  content: '';
  flex: 0 1 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.kf-ornament-diamond {
  width: 6px; height: 6px; background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* =========================================================
   SITE HEADER — minimal & sticky
   ========================================================= */
.kf-site-header {
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(11, 12, 28, 0.92) 0%, rgba(11, 12, 28, 0.8) 100%);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
}

.kf-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.kf-brand-logo {
  width: 46px; height: 46px;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 30% 25%, var(--gold-glow), var(--gold) 55%, var(--gold-900) 100%);
  box-shadow:
    0 4px 16px rgba(201, 160, 89, 0.35),
    inset 0 2px 2px rgba(255, 255, 255, 0.45),
    inset 0 -2px 6px rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  font-family: 'Amiri', serif;
  font-size: 22px;
  color: #2b1f0a;
  font-weight: 700;
  flex-shrink: 0;
}
.kf-brand-logo::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0.5;
}

.kf-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.kf-brand-sub {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 9px; letter-spacing: 4px;
  color: var(--gold-800);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.kf-brand-main {
  font-family: 'Amiri', serif;
  font-size: 22px;
  color: var(--gold-bright);
  font-weight: 700;
  line-height: 1;
}

.kf-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.kf-nav a {
  color: var(--cream);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  border: 1px solid transparent;
}
.kf-nav a:hover, .kf-nav a.active {
  background: rgba(201, 160, 89, 0.08);
  border-color: var(--line);
  color: var(--gold-bright);
}
.kf-nav .kf-nav-cta {
  background: linear-gradient(135deg, var(--gold), var(--gold-800));
  color: #241803;
  font-weight: 700;
  box-shadow: 0 2px 14px rgba(201, 160, 89, 0.4);
  border-color: var(--gold);
}
.kf-nav .kf-nav-cta:hover { background: var(--gold-bright); color: #241803; }

/* Mobile nav (hamburger + drawer) */
.kf-mobile-toggle {
  display: none;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--gold-bright);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.kf-mobile-toggle svg { width: 20px; height: 20px; }

@media (max-width: 760px) {
  .kf-mobile-toggle { display: flex; }
  .kf-nav {
    display: none;
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: var(--ink-900);
    padding: 14px 18px;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    animation: kf-slide-down .2s ease-out;
  }
  .kf-nav.kf-open { display: flex; }
  .kf-nav a { padding: 12px 16px; font-size: 16px; border-radius: 10px; width: 100%; }
  .kf-brand-main { font-size: 20px; }
  .kf-brand-sub  { font-size: 8px; letter-spacing: 3px; }
  .kf-brand-logo { width: 42px; height: 42px; font-size: 20px; }
}
@keyframes kf-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* =========================================================
   HISTORICAL LANDING — minimal, calligraphic, ornate corners
   ========================================================= */
.kf-historical {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  overflow: hidden;
}
.kf-historical::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 45% at 50% 30%, rgba(230, 192, 125, 0.16), transparent 70%),
    radial-gradient(ellipse 40% 40% at 50% 80%, rgba(139, 46, 60, 0.08), transparent 65%);
  pointer-events: none;
}
.kf-corner {
  position: absolute;
  width: 100px;
  height: 100px;
  color: var(--gold);
  opacity: 0.85;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(230, 192, 125, 0.35));
}
.kf-corner-tr { top: 28px; right: 28px; }
.kf-corner-tl { top: 28px; left: 28px; }
.kf-corner-br { bottom: 28px; right: 28px; }
.kf-corner-bl { bottom: 28px; left: 28px; }

.kf-historical-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 780px;
  animation: kf-rise 1.1s cubic-bezier(.16,.84,.44,1) both;
}

.kf-emblem {
  width: 180px;
  height: 180px;
  margin: 0 auto 36px;
  color: var(--gold-bright);
  filter: drop-shadow(0 6px 28px rgba(230, 192, 125, 0.45));
  animation: kf-emblem-spin 80s linear infinite;
}
.kf-emblem svg { width: 100%; height: 100%; }
@keyframes kf-emblem-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.kf-eyebrow {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 13px;
  letter-spacing: 8px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.kf-title {
  font-family: 'Amiri', serif;
  font-size: clamp(52px, 10vw, 120px);
  line-height: 1;
  color: var(--gold-bright);
  margin-bottom: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 0 80px rgba(230, 192, 125, 0.3);
}
.kf-title em {
  font-style: normal;
  background: linear-gradient(180deg, var(--gold-glow) 0%, var(--gold) 55%, var(--gold-800) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding: 0 .05em;
}

.kf-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 auto 32px;
  max-width: 340px;
}
.kf-rule-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.kf-rule-diamond { color: var(--gold); font-size: 18px; text-shadow: 0 0 12px var(--gold-glow); }

.kf-numbers {
  font-family: 'Amiri', serif;
  font-size: clamp(18px, 2.4vw, 24px);
  color: var(--cream);
  letter-spacing: 1px;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.kf-numbers-sep { color: var(--gold); opacity: 0.7; }

.kf-btn-lg { padding: 18px 44px; font-size: 17px; letter-spacing: 1px; }

@media (max-width: 720px) {
  .kf-historical { padding: 40px 24px; }
  .kf-corner { width: 64px; height: 64px; }
  .kf-corner-tr, .kf-corner-tl { top: 14px; }
  .kf-corner-br, .kf-corner-bl { bottom: 14px; top: auto; }
  .kf-corner-tr, .kf-corner-br { right: 14px; }
  .kf-corner-tl, .kf-corner-bl { left: 14px; }
  .kf-emblem { width: 130px; height: 130px; margin-bottom: 28px; }
  .kf-eyebrow { font-size: 11px; letter-spacing: 5px; }
  .kf-title { margin-bottom: 28px; }
  .kf-rule { max-width: 220px; margin-bottom: 24px; }
  .kf-numbers { margin-bottom: 36px; }
  .kf-btn-lg { padding: 16px 36px; font-size: 16px; }
}

/* =========================================================
   HERO (used on other pages)
   ========================================================= */
.kf-hero {
  padding: 100px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.kf-hero-crest {
  width: 84px; height: 84px;
  margin: 0 auto 28px;
  position: relative;
  animation: kf-rise .9s cubic-bezier(.16,.84,.44,1) both;
}
.kf-hero-crest::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--gold-glow), var(--gold) 55%, var(--gold-800) 100%);
  box-shadow: 0 8px 30px rgba(201, 160, 89, 0.45), inset 0 2px 3px rgba(255,255,255,0.5);
}
.kf-hero-crest::after {
  content: '✦';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: 'Amiri', serif;
  font-size: 38px;
  color: #2b1f0a;
}

.kf-hero-dates {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding: 7px 20px;
  border-radius: 99px;
  background: rgba(201, 160, 89, 0.08);
  border: 1px solid var(--line);
  color: var(--gold-bright);
  font-family: 'Amiri', serif;
  font-size: 15px;
  letter-spacing: 2px;
  margin-bottom: 28px;
  animation: kf-rise .9s cubic-bezier(.16,.84,.44,1) .1s both;
}
.kf-hero-dates span { color: var(--gold-800); }

.kf-hero-title {
  font-family: 'Amiri', serif;
  font-size: clamp(44px, 9vw, 96px);
  line-height: 1.05;
  margin-bottom: 22px;
  color: var(--gold-bright);
  text-shadow: 0 0 60px rgba(230, 192, 125, 0.25);
  animation: kf-rise 1s cubic-bezier(.16,.84,.44,1) .15s both;
}
.kf-hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--gold-glow) 0%, var(--gold) 50%, var(--gold-800) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kf-hero-quote {
  font-family: 'Amiri', serif;
  font-style: italic;
  color: var(--cream);
  font-size: clamp(16px, 2.2vw, 22px);
  max-width: 680px;
  margin: 0 auto 36px;
  line-height: 1.8;
  opacity: 0.85;
  animation: kf-rise 1s cubic-bezier(.16,.84,.44,1) .25s both;
}
.kf-hero-quote::before, .kf-hero-quote::after {
  color: var(--gold);
  font-size: 1.3em;
  margin: 0 4px;
  opacity: 0.6;
}
.kf-hero-quote::before { content: '«'; }
.kf-hero-quote::after  { content: '»'; }

.kf-hero-actions {
  display: flex; gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  animation: kf-rise 1s cubic-bezier(.16,.84,.44,1) .35s both;
}

@keyframes kf-rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.kf-btn {
  padding: 13px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--line);
  background: rgba(23, 26, 53, 0.7);
  backdrop-filter: blur(10px);
  color: var(--parchment);
  cursor: pointer;
  transition: all .25s cubic-bezier(.16,.84,.44,1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  position: relative;
  white-space: nowrap;
  min-height: 48px;
}
.kf-btn:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 10px 28px rgba(0,0,0,0.4), 0 0 0 1px rgba(230, 192, 125, 0.18);
}
.kf-btn-primary {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 55%, var(--gold-800) 100%);
  color: #241803;
  border-color: var(--gold);
  font-weight: 700;
  box-shadow: 0 6px 22px rgba(201, 160, 89, 0.42), inset 0 1px 1px rgba(255,255,255,0.35);
}
.kf-btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-glow), var(--gold-bright));
  color: #241803;
  box-shadow: 0 10px 30px rgba(230, 192, 125, 0.5);
}
.kf-btn-ghost  { background: transparent; }
.kf-btn-danger { background: transparent; border-color: rgba(227, 115, 115, 0.4); color: var(--danger); }
.kf-btn-danger:hover { background: rgba(227, 115, 115, 0.12); border-color: var(--danger); color: #fff; }
.kf-btn-sm { padding: 8px 14px; font-size: 13px; min-height: 36px; }

/* =========================================================
   SECTIONS
   ========================================================= */
.kf-section { padding: 80px 20px; position: relative; }
.kf-section-eyebrow {
  display: block;
  text-align: center;
  font-family: 'Reem Kufi', sans-serif;
  font-size: 11px; letter-spacing: 6px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.kf-section-title {
  font-family: 'Amiri', serif;
  font-size: clamp(28px, 5vw, 44px);
  text-align: center;
  margin-bottom: 14px;
  color: var(--gold-bright);
  line-height: 1.2;
}
.kf-section-sub {
  text-align: center;
  color: var(--parchment-dim);
  margin: 0 auto 48px;
  font-size: 16px;
  line-height: 1.8;
  max-width: 640px;
}

/* =========================================================
   CARDS — heritage tiles
   ========================================================= */
.kf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}
.kf-card {
  background: linear-gradient(160deg, rgba(23, 26, 53, 0.55), rgba(17, 19, 42, 0.72));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: all .3s cubic-bezier(.16,.84,.44,1);
  position: relative;
  overflow: hidden;
}
.kf-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230,192,125,0.45), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.kf-card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.kf-card:hover::before { opacity: 1; }
.kf-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(230, 192, 125, 0.16), rgba(201, 160, 89, 0.06));
  border: 1px solid var(--line-soft);
  display: grid; place-items: center;
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--gold-bright);
}
.kf-card h3 {
  font-family: 'Reem Kufi', sans-serif;
  color: var(--gold-bright);
  font-size: 20px;
  margin-bottom: 10px;
  font-weight: 500;
}
.kf-card p { color: var(--parchment-dim); line-height: 1.8; font-size: 14.5px; }

/* =========================================================
   STATS — heritage numerals
   ========================================================= */
.kf-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  max-width: 1000px;
  margin: 0 auto;
}
.kf-stat {
  text-align: center;
  padding: 26px 16px;
  background: linear-gradient(160deg, rgba(23, 26, 53, 0.6), rgba(17, 19, 42, 0.4));
  backdrop-filter: blur(18px);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  transition: all .3s;
  position: relative;
  overflow: hidden;
}
.kf-stat:hover { border-color: var(--line); transform: translateY(-3px); }
.kf-stat::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top, rgba(230, 192, 125, 0.08), transparent 60%);
  pointer-events: none;
}
.kf-stat-value {
  font-family: 'Amiri', serif;
  font-size: clamp(36px, 5vw, 54px);
  color: var(--gold-bright);
  margin-bottom: 4px;
  line-height: 1;
  font-weight: 700;
  position: relative;
}
.kf-stat-label {
  color: var(--parchment-dim);
  font-size: 12px;
  letter-spacing: 2px;
  font-family: 'Reem Kufi', sans-serif;
  position: relative;
}

/* =========================================================
   INSIGHTS — heritage manuscript data panels
   ========================================================= */
.kf-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}
.kf-insight {
  background: linear-gradient(160deg, rgba(23, 26, 53, 0.55), rgba(17, 19, 42, 0.72));
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  backdrop-filter: blur(18px);
}
.kf-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.kf-insight-head h4 {
  font-family: 'Reem Kufi', sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--gold-800);
  text-transform: uppercase;
  font-weight: 500;
}
.kf-insight-body {
  font-family: 'Amiri', serif;
  font-size: 22px;
  color: var(--gold-bright);
  line-height: 1.4;
  margin-bottom: 6px;
}
.kf-insight-detail {
  color: var(--parchment-dim);
  font-size: 13px;
  line-height: 1.6;
}

/* Timeline strip */
.kf-timeline {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 20px 0 10px;
  scrollbar-width: thin;
}
.kf-timeline::-webkit-scrollbar { height: 6px; }
.kf-timeline::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.kf-timeline-item {
  flex: 0 0 auto;
  min-width: 100px;
  padding: 14px 12px;
  background: rgba(23, 26, 53, 0.55);
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  text-align: center;
}
.kf-timeline-gen {
  font-family: 'Amiri', serif;
  font-size: 24px;
  color: var(--gold-bright);
  line-height: 1;
}
.kf-timeline-count {
  margin-top: 4px;
  font-size: 11px;
  color: var(--parchment-dim);
  letter-spacing: 1px;
}

/* =========================================================
   FORMS — clean, warm
   ========================================================= */
.kf-form {
  max-width: 540px;
  margin: 0 auto;
  background: linear-gradient(160deg, rgba(23, 26, 53, 0.7), rgba(17, 19, 42, 0.85));
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.kf-form::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}
.kf-form::after {
  content: '✦';
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 14px;
  opacity: 0.6;
}

.kf-form-title {
  font-family: 'Amiri', serif;
  font-size: 30px;
  text-align: center;
  margin-bottom: 10px;
  color: var(--gold-bright);
}
.kf-form-sub {
  text-align: center;
  color: var(--parchment-dim);
  margin-bottom: 32px;
  font-size: 14px;
  line-height: 1.7;
}

.kf-field { margin-bottom: 18px; position: relative; }
.kf-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--cream);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.kf-field input, .kf-field select, .kf-field textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(11, 12, 28, 0.7);
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  color: var(--parchment);
  font-family: inherit;
  font-size: 16px;
  transition: all .2s;
  direction: rtl;
  min-height: 48px;
}
.kf-field input:focus, .kf-field select:focus, .kf-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(11, 12, 28, 0.9);
  box-shadow: 0 0 0 4px rgba(230, 192, 125, 0.12);
}
.kf-field input::placeholder, .kf-field textarea::placeholder { color: rgba(201, 189, 161, 0.45); }
.kf-field textarea { resize: vertical; min-height: 130px; }

.kf-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .kf-form-row { grid-template-columns: 1fr; } }

.kf-form-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.kf-form-actions .kf-btn { flex: 1; justify-content: center; max-width: 220px; min-width: 140px; }

/* =========================================================
   ALERTS
   ========================================================= */
.kf-alert {
  padding: 13px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.6;
}
.kf-alert-success { background: rgba(143, 208, 166, 0.08); border-color: rgba(143, 208, 166, 0.35); color: var(--success); }
.kf-alert-error   { background: rgba(227, 115, 115, 0.08); border-color: rgba(227, 115, 115, 0.4);  color: var(--danger); }
.kf-alert-info    { background: rgba(230, 192, 125, 0.08); border-color: var(--line); color: var(--gold-bright); }

/* =========================================================
   FOOTER
   ========================================================= */
.kf-site-footer {
  padding: 56px 20px 36px;
  text-align: center;
  color: var(--parchment-dim);
  font-size: 14px;
  margin-top: 60px;
  border-top: 1px solid var(--glass-line);
  background: linear-gradient(180deg, transparent 0%, rgba(11, 12, 28, 0.6) 100%);
}
.kf-footer-brand {
  font-family: 'Amiri', serif;
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--gold-bright);
}
.kf-footer-crest {
  display: inline-flex;
  gap: 16px;
  color: var(--gold);
  margin-bottom: 16px;
  align-items: center;
  font-size: 16px;
}
.kf-footer-crest::before, .kf-footer-crest::after { content: '—'; opacity: 0.5; }
.kf-footer-links { display: flex; justify-content: center; gap: 20px; margin-top: 18px; flex-wrap: wrap; }
.kf-footer-links a { color: var(--parchment-dim); }
.kf-footer-links a:hover { color: var(--gold-bright); }
.kf-footer-bottom {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-line);
  color: var(--gold-800);
  font-size: 12px;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.kf-login-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  position: relative;
}
.kf-login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 40% at 50% 40%, rgba(230, 192, 125, 0.1), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.kf-login-page .kf-form { position: relative; z-index: 1; width: 100%; }

.kf-security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 22px;
  color: var(--parchment-dim);
  font-size: 12px;
  text-align: center;
}
.kf-security-note svg { width: 14px; height: 14px; opacity: 0.7; }

/* =========================================================
   TREE PAGE wrapper
   ========================================================= */
.kf-tree-wrap {
  height: calc(100vh - var(--header-h));
  overflow: hidden;
  position: relative;
}

/* =========================================================
   ADMIN tables
   ========================================================= */
.kf-table-wrap {
  background: linear-gradient(160deg, rgba(23, 26, 53, 0.55), rgba(17, 19, 42, 0.72));
  backdrop-filter: blur(18px);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 22px;
}
.kf-table { width: 100%; border-collapse: collapse; }
.kf-table th, .kf-table td { padding: 14px 16px; text-align: right; border-bottom: 1px solid var(--glass-line); }
.kf-table th {
  background: rgba(11, 12, 28, 0.55);
  color: var(--gold-bright);
  font-family: 'Reem Kufi', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 1px;
}
.kf-table tbody tr:hover { background: rgba(230, 192, 125, 0.04); }
.kf-table tbody tr:last-child td { border-bottom: none; }

.kf-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  background: rgba(255,255,255,0.06);
  color: var(--parchment-dim);
  font-family: 'Reem Kufi', sans-serif;
}
.kf-badge-male   { background: rgba(122, 168, 224, 0.18); color: var(--male); }
.kf-badge-female { background: rgba(230, 159, 184, 0.18); color: var(--female); }
.kf-badge-gen    { background: rgba(230, 192, 125, 0.14); color: var(--gold-bright); }

/* =========================================================
   WATERMARK (anti-leak)
   ========================================================= */
.kf-watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  display: grid;
  grid-template-columns: repeat(auto-fill, 300px);
  grid-auto-rows: 200px;
  opacity: 0.045;
  overflow: hidden;
  user-select: none;
}
.kf-watermark span {
  color: #fff;
  font-size: 12px;
  transform: rotate(-28deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Reem Kufi', sans-serif;
  letter-spacing: 2px;
  white-space: nowrap;
}

/* =========================================================
   MOBILE RESPONSIVE polishes
   ========================================================= */
@media (max-width: 720px) {
  .kf-site-header { padding: 10px 14px; }
  .kf-hero { padding: 60px 18px 50px; }
  .kf-hero-crest { width: 64px; height: 64px; margin-bottom: 20px; }
  .kf-hero-crest::after { font-size: 28px; }
  .kf-hero-dates { font-size: 13px; padding: 6px 14px; letter-spacing: 1.5px; }
  .kf-form { padding: 28px 20px; border-radius: 16px; }
  .kf-form-title { font-size: 24px; }
  .kf-section { padding: 56px 18px; }
  .kf-section-title { font-size: 26px; }
  .kf-section-sub { font-size: 15px; margin-bottom: 36px; }
  .kf-card { padding: 22px 20px; }
  .kf-stat { padding: 20px 12px; }
  .kf-footer-links { gap: 14px; font-size: 13px; }
  .kf-hero-actions .kf-btn { width: 100%; max-width: 320px; }
}

/* Touch device polish */
@media (hover: none) {
  .kf-btn:hover, .kf-card:hover, .kf-stat:hover { transform: none; }
}
