/* ============================================================
   منصة ياء - Yaa Platform
   نظام SaaS لإدارة المكاتب القانونية
   الألوان: بنفسجي/نيلي + سماوي
   ============================================================ */

:root {
  /* === Primary: Indigo (legacy name kept as --green-*) === */
  --green-900: #1e1b4b;
  --green-800: #312e81;
  --green-700: #4338ca;
  --green-600: #4f46e5;
  --green-500: #6366f1;
  --green-100: #e0e7ff;
  --green-50:  #eef2ff;

  /* Alias modern names */
  --indigo-900: #1e1b4b;
  --indigo-800: #312e81;
  --indigo-700: #4338ca;
  --indigo-600: #4f46e5;
  --indigo-500: #6366f1;
  --indigo-400: #818cf8;
  --indigo-100: #e0e7ff;
  --indigo-50:  #eef2ff;

  /* === Accent: Cyan (legacy name kept as --gold-*) === */
  --gold-700: #155e75;
  --gold-600: #0e7490;
  --gold-500: #06b6d4;
  --gold-400: #22d3ee;
  --gold-100: #cffafe;

  --cyan-700: #155e75;
  --cyan-600: #0e7490;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --cyan-300: #67e8f9;
  --cyan-100: #cffafe;
  --cyan-50:  #ecfeff;

  /* === Slate neutrals === */
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-100: #e2e8f0;

  --bg:       #f8fafc;
  --card:     #ffffff;
  --border:   #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md: 0 4px 14px rgba(67,56,202,.10), 0 2px 6px rgba(15,23,42,.05);
  --shadow-lg: 0 20px 50px rgba(67,56,202,.22), 0 8px 20px rgba(15,23,42,.08);

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 18px;

  --danger: #ef4444;
  --warn:   #f59e0b;
  --ok:     #10b981;
  --info:   #3b82f6;

  /* === Signature brand gradient === */
  --grad-brand: linear-gradient(135deg, #4338ca 0%, #6366f1 35%, #06b6d4 100%);
  --grad-brand-soft: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --grad-accent: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink-900);
  line-height: 1.6;
  direction: rtl;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--gold-600); }
img { max-width: 100%; }

.container { width: min(1200px, 92%); margin-inline: auto; }
.muted { color: var(--ink-500); }
.gold { color: var(--gold-500); }
.green { color: var(--green-700); }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

h1,h2,h3,h4 { font-family: 'Tajawal', sans-serif; color: var(--green-900); font-weight: 700; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); line-height: 1.2; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 700; font-size: .95rem;
  cursor: pointer; transition: all .2s ease;
  border: 1px solid transparent;
  background: var(--green-700); color: #fff;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-primary { background: var(--grad-brand); color: #fff; border: 1px solid var(--indigo-700); box-shadow: 0 4px 14px rgba(67,56,202,.30); }
.btn-primary:hover { background: linear-gradient(135deg, var(--indigo-800), var(--indigo-700)); color: #fff; }
.btn-gold { background: var(--grad-accent); color: #fff; border: 1px solid var(--cyan-600); box-shadow: 0 6px 18px rgba(6,182,212,.35); }
.btn-gold:hover { background: linear-gradient(135deg, var(--cyan-600), var(--cyan-500)); color: #fff; }
.btn-outline-gold { background: transparent; color: var(--gold-500); border: 1px solid var(--gold-500); }
.btn-outline-gold:hover { background: var(--gold-500); color: var(--green-900); }
.btn-outline-light { background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-outline-light:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #962a1f; color: #fff; }
.btn-success { background: var(--ok); color: #fff; }
.btn-soft { background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-100); }
.btn-soft:hover { background: var(--green-100); color: var(--green-900); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ===== Landing ===== */
.landing-header {
  position: absolute; inset-inline: 0; top: 0; z-index: 10;
  padding: 18px 0;
  background: linear-gradient(to bottom, rgba(11,61,46,.55), rgba(11,61,46,0));
}
.landing-header.scrolled {
  position: fixed; background: rgba(11,61,46,.95); backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(255,255,255,.06);
  display: grid; place-items: center;
  padding: 4px;
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text .brand-title { font-weight: 900; font-size: 1rem; line-height: 1.15; }
.brand-text .brand-sub { font-size: .7rem; color: var(--gold-400); margin-top: 1px; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: #fff; font-weight: 500; opacity: .9; }
.nav-links a:hover { color: var(--gold-400); opacity: 1; }
.nav-cta { display: flex; gap: 10px; }

.hero {
  position: relative; min-height: 100vh; color: #fff;
  display: grid; place-items: center; overflow: hidden;
  background: #0f172a;
  perspective: 1200px;
}
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
  filter: brightness(.50) contrast(1.05) saturate(.85) hue-rotate(-15deg);
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(99,102,241,.65) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(6,182,212,.55) 0%, transparent 55%),
    linear-gradient(180deg, rgba(15,23,42,.70) 0%, rgba(30,27,75,.60) 40%, rgba(15,23,42,.95) 100%);
}

/* 3D animated orbs */
.hero-orbs {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: .5;
}
.orb.o1 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: 8%; right: 10%;
  animation: orbDrift 14s ease-in-out infinite;
}
.orb.o2 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #22d3ee, transparent 70%);
  bottom: 12%; left: 8%;
  animation: orbDrift 18s ease-in-out infinite reverse;
}
.orb.o3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #818cf8, transparent 70%);
  top: 50%; right: 40%;
  animation: orbDrift 11s ease-in-out infinite;
}
@keyframes orbDrift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(60px,-40px) scale(1.15); }
  66%      { transform: translate(-50px, 70px) scale(.9); }
}

/* 3D floating stack cards */
.hero-3d-stack {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  transform-style: preserve-3d;
}
.stack-card {
  position: absolute;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 18px;
  padding: 16px 20px; min-width: 220px;
  color: #fff;
  display: flex; gap: 12px; align-items: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.05);
  transform-style: preserve-3d;
}
.stack-card b { display: block; font-size: .85rem; color: #fff; }
.stack-card span { font-size: 1.1rem; font-weight: 800; color: var(--cyan-300); }
.stack-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--grad-brand-soft);
  display: grid; place-items: center; color: #fff;
  font-size: 1.05rem; flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(99,102,241,.4);
}
.stack-bar {
  position: absolute; left: 16px; right: 16px; bottom: 8px; height: 4px;
  background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden;
}
.stack-bar::after {
  content:''; display:block; height:100%; width: var(--w, 62%);
  background: var(--grad-accent); border-radius: 2px;
  animation: barShine 3s ease-in-out infinite;
}
@keyframes barShine {
  0%, 100% { opacity: 1; }
  50%      { opacity: .6; }
}
.stack-card.sc1 { top: 18%; left: 6%;  transform: rotateY(8deg) rotateX(-3deg); animation: floatStack 9s ease-in-out infinite; }
.stack-card.sc2 { top: 48%; left: 9%;  transform: rotateY(8deg) rotateX(-3deg); animation: floatStack 11s ease-in-out infinite -2s; }
.stack-card.sc3 { top: 30%; right: 7%; transform: rotateY(-8deg) rotateX(-3deg); animation: floatStack 10s ease-in-out infinite -1s; }
@keyframes floatStack {
  0%, 100% { transform: translateY(0) rotateY(8deg) rotateX(-3deg); }
  50%      { transform: translateY(-20px) rotateY(8deg) rotateX(-3deg); }
}
.stack-card.sc3 {
  animation-name: floatStackRight;
}
@keyframes floatStackRight {
  0%, 100% { transform: translateY(0) rotateY(-8deg) rotateX(-3deg); }
  50%      { transform: translateY(-24px) rotateY(-8deg) rotateX(-3deg); }
}

/* Hero badge sparkle */
.hero-badge i { animation: spark 2s ease-in-out infinite; }
@keyframes spark {
  0%, 100% { transform: rotate(0); opacity: 1; }
  50%      { transform: rotate(20deg); opacity: .6; }
}

/* Hide 3D stack on smaller screens (avoid clutter) */
@media (max-width: 1100px) {
  .hero-3d-stack { display: none; }
}
@media (max-width: 640px) {
  .orb.o3 { display: none; }
  .orb.o1 { width: 240px; height: 240px; }
  .orb.o2 { width: 200px; height: 200px; }
}
.hero-content {
  position: relative; z-index: 2; padding: 130px 0 80px;
  text-align: center; max-width: 900px;
}
.hero-logo-wrap {
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: fadeUp .8s ease both;
}
.hero-logo {
  width: clamp(160px, 20vmin, 240px);
  display: block;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,.5));
}
.hero-logo-name {
  margin-top: -14px;
  text-align: center;
  padding: 6px 24px;
  background: linear-gradient(135deg, #e5c869, #c9a227, #a07c1c);
  border-radius: 6px;
  border: 1.5px solid #8c6914;
  box-shadow: 0 8px 22px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.2);
  max-width: 90%;
}
.hero-logo-name .hln-1 {
  font-family: 'Amiri', 'Tajawal', serif;
  font-weight: 700;
  font-size: clamp(.85rem, 2vw, 1.05rem);
  color: #5b3a1e;
  letter-spacing: .5px;
  line-height: 1.3;
}
.hero-logo-name .hln-2 {
  font-family: 'Amiri', 'Tajawal', serif;
  font-weight: 600;
  font-size: clamp(.7rem, 1.6vw, .85rem);
  color: #5b3a1e;
  margin-top: 1px;
}
@keyframes fadeUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: rgba(212,175,55,.15); color: var(--gold-400);
  border: 1px solid var(--gold-500); font-size: .9rem; margin-bottom: 16px;
}
.hero-title { color: #fff; margin: 0 0 18px; font-weight: 900; }
.hero-sub { font-size: 1.15rem; opacity: .92; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 60px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  border-top: 1px solid rgba(255,255,255,.18);
  padding-top: 28px;
}
.hero-stats > div { text-align: center; }
.hero-stats strong { display: block; font-size: 2rem; color: var(--gold-400); font-weight: 900; }
.hero-stats span { font-size: .9rem; opacity: .85; }
.scroll-down {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.1); color: #fff; z-index: 3;
  animation: bounce 2s infinite;
}
@keyframes bounce { 0%,100%{transform:translateX(-50%) translateY(0);} 50%{transform:translateX(-50%) translateY(-8px);} }

.section { padding: 90px 0; }
.section-head { text-align: center; max-width: 700px; margin: 0 auto 50px; }
.eyebrow {
  display: inline-block; color: var(--gold-600); font-weight: 700;
  letter-spacing: 4px; font-size: .85rem; text-transform: uppercase; margin-bottom: 8px;
  position: relative; padding: 0 14px;
}
.eyebrow::before, .eyebrow::after {
  content: ''; position: absolute; top: 50%; width: 24px; height: 2px;
  background: var(--gold-500);
}
.eyebrow::before { right: -28px; }
.eyebrow::after  { left:  -28px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.feature-list { list-style: none; padding: 0; margin: 18px 0; }
.feature-list li { padding: 8px 0; display: flex; gap: 10px; align-items: center; }
.feature-list i { color: var(--gold-600); }

.about-card {
  background: linear-gradient(180deg, #fff 0%, var(--green-50) 100%);
  border: 1px solid var(--ink-100); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow-md);
  border-right: 4px solid var(--gold-500);
}
.card-icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--green-700); color: var(--gold-400);
  display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 12px;
}
.about-card h3 { margin: 6px 0; }
.about-card h3 + p + .card-icon { margin-top: 28px; }

.services {
  background: linear-gradient(180deg, #fff 0%, var(--green-50) 100%);
}
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
}
.service-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px; box-shadow: var(--shadow-sm);
  transition: all .25s ease; position: relative; overflow: hidden;
}
.service-card::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 4px;
  background: linear-gradient(90deg, var(--gold-500), var(--green-600));
  transform: scaleX(0); transform-origin: right; transition: transform .3s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold-500); }
.service-card:hover::after { transform: scaleX(1); }
.service-icon {
  width: 60px; height: 60px; border-radius: 14px;
  background: var(--green-50); color: var(--green-700);
  display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 18px;
}

.cta {
  background: linear-gradient(135deg, var(--green-800), var(--green-900));
  color: #fff;
}
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.cta h2 { color: #fff; margin: 0 0 6px; }
.cta p { color: rgba(255,255,255,.8); margin: 0; }

.contact { background: #fff; }
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: 12px 0; display: flex; gap: 10px; align-items: center; border-bottom: 1px dashed var(--ink-100); }
.contact-list i {
  color: var(--gold-600); width: 36px; height: 36px;
  background: var(--gold-100); border-radius: 50%; display: grid; place-items: center;
}
.contact-form { background: var(--green-50); padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--green-100); }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 14px; margin-bottom: 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff; font-family: inherit; font-size: 1rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px var(--gold-100); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row input { margin-bottom: 0; }

.footer {
  background: var(--green-900); color: rgba(255,255,255,.85);
  padding: 60px 0 0;
}
.footer h4 { color: var(--gold-400); margin-bottom: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; }
.footer ul { list-style: none; padding: 0; }
.footer ul li { padding: 5px 0; }
.footer ul li a { color: rgba(255,255,255,.75); }
.footer ul li a:hover { color: var(--gold-400); }
.footer .brand-text .brand-title, .footer .brand-text .brand-sub { color: #fff; }
.footer-bottom {
  margin-top: 50px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.1);
  font-size: .9rem;
}
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ===== Tablet (≤ 900px) ===== */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta .btn { padding: 8px 12px; font-size: .85rem; }
  .two-col, .services-grid, .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 60px 0; }
  .hero-content { padding: 110px 0 60px; }
  h1 { font-size: 2.4rem !important; }
}

/* ===== Mobile (≤ 640px) ===== */
@media (max-width: 640px) {
  .landing-header { padding: 12px 0; }
  .nav { gap: 8px; flex-wrap: wrap; justify-content: center; }
  .brand { gap: 8px; order: 1; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-text .brand-title { font-size: .8rem; }
  .brand-text .brand-sub { font-size: .62rem; }
  .nav-cta { order: 2; gap: 6px; width: 100%; justify-content: center; }
  .nav-cta .btn { padding: 7px 10px; font-size: .78rem; flex: 1; max-width: 160px; justify-content: center; }
  .nav-cta .btn i { font-size: .8rem; }

  .hero { min-height: auto; }
  .hero-content { padding: 180px 0 50px; }
  .hero-title { font-size: 1.9rem !important; line-height: 1.25; }
  .hero-sub { font-size: .95rem; }
  .hero-actions { flex-direction: column; gap: 8px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-actions .btn-lg { padding: 12px 18px; font-size: .95rem; }
  .hero-stats { gap: 12px; padding-top: 18px; }
  .hero-stats strong { font-size: 1.4rem; }
  .hero-stats span { font-size: .75rem; }
  .hero-logo { width: clamp(140px, 50vw, 180px); }
  .hero-logo-name { padding: 5px 14px; max-width: 95%; }
  .hero-logo-name .hln-1 { font-size: .8rem; }
  .hero-logo-name .hln-2 { font-size: .68rem; }

  .section { padding: 50px 0; }
  .section-head { margin-bottom: 30px; }
  h1 { font-size: 1.8rem !important; }
  h2 { font-size: 1.4rem !important; }
  .eyebrow::before, .eyebrow::after { width: 14px; }
  .eyebrow::before { right: -18px; } .eyebrow::after { left: -18px; }

  .about-card { padding: 24px; }
  .service-card { padding: 20px; }
  .cta-inner { flex-direction: column; text-align: center; }
  .contact-form { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .footer { padding: 40px 0 0; }
  .footer-bottom .container { flex-direction: column; text-align: center; gap: 6px; font-size: .8rem; }

  .scroll-down { bottom: 12px; }
}

/* ===== Very small phones (≤ 380px) ===== */
@media (max-width: 380px) {
  .brand-text { display: none; }
  .nav-cta .btn { font-size: .72rem; padding: 6px 8px; }
  .hero-title { font-size: 1.6rem !important; }
}

/* =====================================================
   COMPREHENSIVE MOBILE POLISHING
   ===================================================== */

/* Tablet-landscape down */
@media (max-width: 1100px) {
  .hero-content { padding: 100px 0 60px; }
}

/* Tablet portrait */
@media (max-width: 900px) {
  /* Floating cards in auth-side */
  .float-cards { display: none; }
}

/* Mobile */
@media (max-width: 640px) {
  /* Hide 3D animated decorations that take perf */
  .hero-3d-stack { display: none; }
  .float-cards { display: none; }

  /* Make hero more compact */
  .hero { min-height: 90vh; }
  .hero-content { padding: 100px 0 40px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 22px; }
  .hero-stats strong { font-size: 1.5rem; }

  /* Feature/Step cards stack nicely */
  .feature-card { padding: 22px; }
  .feature-icon { width: 50px; height: 50px; font-size: 1.25rem; }
  .step { padding: 24px 18px; }
  .step-num { width: 54px; height: 54px; font-size: 1.4rem; }

  /* Auth wrap: full-screen mobile experience */
  .auth-wrap { display: block; min-height: 100vh; }
  .auth-side {
    display: flex !important; padding: 24px;
    min-height: 35vh; flex-direction: row; align-items: center; justify-content: space-between;
  }
  .auth-side .pitch { display: none; }
  .auth-side > div:last-child { display: none; }
  .auth-side .brand { margin: 0; }
  .auth-side::before, .auth-side::after { opacity: .8; }
  .auth-main { padding: 24px 16px; }
  .auth-card { padding: 28px 22px; }

  /* Testimonials (left as-is if any return) */
  .testi-grid { grid-template-columns: 1fr; }

  /* FAQ */
  .faq-item summary { padding: 14px 16px; font-size: .95rem; }
  .faq-item p { padding: 12px 16px 18px; font-size: .9rem; }

  /* Final CTA */
  .cta-card { padding: 30px 22px; flex-direction: column; text-align: center; gap: 20px; }
  .cta-card h2 { font-size: 1.5rem; }
  .cta-actions { flex-direction: column; width: 100%; }
  .cta-actions .btn { width: 100%; justify-content: center; }

  /* Trust bar */
  .logo-chip { padding: 8px 14px; font-size: .8rem; }

  /* Hero badge */
  .hero-badge { font-size: .8rem; padding: 5px 12px; }

  /* Section headings */
  h2 { font-size: 1.5rem !important; }
  .section { padding: 50px 0; }
  .section-head { margin-bottom: 28px; }
}

/* Extra-small (≤480) */
@media (max-width: 480px) {
  .hero-title { font-size: 1.7rem !important; }
  .hero-sub { font-size: .92rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .nav-cta .btn span,
  .nav-cta .btn { font-size: .75rem; }
  .container { width: 94%; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-text .brand-title { font-size: .82rem; }
}

/* Phones < 380 */
@media (max-width: 380px) {
  .nav { gap: 6px; }
  .brand-text { display: none; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .nav-cta .btn { padding: 7px 10px; }
}

/* Disable heavy animations on small/low-end devices */
@media (prefers-reduced-motion: reduce) {
  .orb, .stack-card, .float-card,
  .hero-logo-wrap, .step:hover, .feature-card:hover,
  .feature-card:hover .feature-icon { animation: none !important; transition: none !important; }
}

/* Disable filter/blur backdrop on Android Chrome (perf) */
@supports not (backdrop-filter: blur(1px)) {
  .stack-card, .float-card { background: rgba(255,255,255,.18); }
}

/* ============================================================
   SaaS Landing - Yaa Platform
   ============================================================ */
.grad-text {
  background: var(--grad-brand-soft);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.center { text-align: center; }

/* Trust Bar */
.trust-bar { padding: 40px 0; background: #fff; border-bottom: 1px solid var(--border); }
.logo-strip {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 18px;
}
.logo-chip {
  padding: 10px 18px; border: 1px solid var(--border); border-radius: 12px;
  color: var(--ink-500); font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; gap: 8px;
  transition: all .2s;
}
.logo-chip:hover { border-color: var(--indigo-500); color: var(--indigo-700); transform: translateY(-2px); }
.logo-chip i { color: var(--cyan-500); }

/* Features */
.features { background: var(--bg); }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.feature-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; transition: all .35s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden;
  transform-style: preserve-3d;
}
.feature-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height: 3px;
  background: var(--grad-brand-soft);
  transform: scaleX(0); transform-origin: right; transition: transform .35s;
}
.feature-card::after {
  content:''; position: absolute; inset: -1px;
  background: linear-gradient(135deg, rgba(99,102,241,.35), rgba(34,211,238,.25));
  border-radius: inherit; z-index: -1;
  opacity: 0; transition: opacity .3s;
  filter: blur(18px);
}
.feature-card:hover { transform: translateY(-8px) rotateX(2deg); box-shadow: var(--shadow-lg); border-color: var(--indigo-500); }
.feature-card:hover::before { transform: scaleX(1); }
.feature-card:hover::after { opacity: 1; }
.feature-icon {
  width: 60px; height: 60px; border-radius: 16px;
  background: var(--grad-brand);
  color: #fff; display: grid; place-items: center;
  font-size: 1.5rem; margin-bottom: 18px;
  box-shadow: 0 14px 30px rgba(67,56,202,.35), inset 0 0 0 1px rgba(255,255,255,.2);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.feature-card:hover .feature-icon { transform: translateY(-4px) rotate(-6deg) scale(1.05); }

/* How */
.how { background: #fff; }
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative;
}
.step {
  text-align: center; padding: 30px 24px; background: var(--bg);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  position: relative; transition: all .35s cubic-bezier(.2,.8,.2,1);
  transform-style: preserve-3d;
}
.step:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-lg);
  background: #fff;
}
.step-num {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--grad-brand); color: #fff;
  display: grid; place-items: center; margin: 0 auto 16px;
  font-size: 1.7rem; font-weight: 900;
  box-shadow: 0 14px 30px rgba(67,56,202,.35), inset 0 0 0 1px rgba(255,255,255,.2);
  transform: rotate(-6deg); transition: transform .35s;
}
.step:hover .step-num { transform: rotate(0deg) scale(1.06); }

/* Pricing */
.pricing { background: var(--bg); }
.pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch;
}
.price-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px 26px; position: relative;
  display: flex; flex-direction: column;
  transition: all .25s;
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.price-card.featured {
  background: var(--grad-brand);
  color: #fff; border: 0;
  transform: scale(1.04);
  box-shadow: 0 30px 60px rgba(67,56,202,.35);
}
.price-card.featured h3 { color: #fff; }
.price-card.featured .price-features li { color: rgba(255,255,255,.95); }
.price-card.featured .price-features i { color: var(--cyan-400); }
.price-badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: .75rem; font-weight: 800; margin-bottom: 12px;
  background: var(--ink-100); color: var(--ink-700);
}
.price-badge.gold { background: var(--grad-accent); color: #fff; }
.price-card.featured .price-badge.gold { background: rgba(255,255,255,.2); color: #fff; }
.price h3 { margin-bottom: 8px; }
.price { margin: 12px 0 22px; }
.price .amt { font-size: 2.2rem; font-weight: 900; color: var(--indigo-700); }
.price-card.featured .price .amt { color: #fff; }
.price .cur { color: var(--ink-500); font-size: .9rem; margin-right: 6px; }
.price-card.featured .price .cur { color: rgba(255,255,255,.8); }
.price-features {
  list-style: none; padding: 0; margin: 0 0 22px;
  flex: 1;
}
.price-features li { padding: 7px 0; display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.price-features li i { color: var(--ok); }
.price-features li.dim { opacity: .55; }
.price-features li.dim i { color: var(--ink-500); }

/* Testimonials */
.testimonials { background: #fff; }
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.testi-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; position: relative;
}
.testi-card::before {
  content:'"'; position:absolute; top:-22px; right:18px;
  font-size: 5rem; color: var(--indigo-500); opacity:.25;
  font-family: serif; line-height: 1;
}
.testi-card .stars { color: var(--cyan-500); margin-bottom: 10px; font-size: 1rem; }
.testi-card > p { font-style: italic; margin-bottom: 18px; }
.testi-author { display: flex; gap: 12px; align-items: center; }
.avatar-circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad-brand);
  color: #fff; display: grid; place-items: center; font-weight: 700;
  flex-shrink: 0;
}
.testi-author b { display: block; }
.testi-author span { font-size: .85rem; }

/* FAQ */
.faq { background: var(--bg); }
.faq-list { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0; overflow: hidden;
}
.faq-item summary {
  padding: 18px 22px; cursor: pointer; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary i { color: var(--indigo-500); transition: transform .2s; }
.faq-item[open] summary i { transform: rotate(180deg); }
.faq-item[open] summary { color: var(--indigo-700); border-bottom: 1px solid var(--border); }
.faq-item p { padding: 16px 22px 22px; margin: 0; color: var(--ink-700); }

/* Final CTA */
.final-cta { background: #fff; padding-bottom: 60px; }
.cta-card {
  background: var(--grad-brand);
  border-radius: var(--radius-lg);
  padding: 60px 50px;
  color: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap;
  position: relative; overflow: hidden;
  box-shadow: 0 30px 60px rgba(67,56,202,.30);
}
.cta-card::before {
  content:''; position:absolute; inset:0;
  background-image:
    radial-gradient(circle at 90% 10%, rgba(255,255,255,.18) 0%, transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(34,211,238,.25) 0%, transparent 40%);
}
.cta-card > * { position: relative; z-index: 1; }
.cta-card h2 { color: #fff; margin: 0 0 8px; }
.cta-card p { color: rgba(255,255,255,.85); margin: 0; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cta-card .grad-text {
  background: linear-gradient(135deg, #fef3c7, #22d3ee);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.socials { display: flex; gap: 10px; }
.socials a {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.8);
  display: grid; place-items: center;
  transition: all .2s;
}
.socials a:hover { background: var(--cyan-500); color: #fff; transform: translateY(-2px); }

/* Hero badge - tweaks */
.landing .hero-badge {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(34,211,238,.25));
  color: var(--cyan-300);
  border-color: rgba(34,211,238,.5);
}

@media (max-width: 900px) {
  .features-grid, .pricing-grid, .testi-grid, .steps { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
  .cta-card { padding: 36px 24px; text-align: center; }
  .cta-card .cta-actions { justify-content: center; }
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.auth-side {
  position: relative;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 35%, #4338ca 70%, #0e7490 100%);
  color: #fff; padding: 50px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
}
/* Animated gradient orbs */
.auth-side::before,
.auth-side::after {
  content:''; position:absolute; border-radius:50%;
  filter: blur(80px); z-index: -1;
  will-change: transform;
}
.auth-side::before {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(99,102,241,.6), transparent 70%);
  top: -120px; right: -120px;
  animation: orbFloat 12s ease-in-out infinite;
}
.auth-side::after {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(34,211,238,.55), transparent 70%);
  bottom: -80px; left: -80px;
  animation: orbFloat 14s ease-in-out infinite reverse;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(60px, -40px) scale(1.1); }
  66%      { transform: translate(-30px, 50px) scale(.95); }
}
/* Decorative mesh overlay */
.auth-side .mesh-bg {
  position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(99,102,241,.25) 0%, transparent 35%),
    radial-gradient(circle at 75% 75%, rgba(34,211,238,.25) 0%, transparent 35%);
}
/* Floating 3D glass cards - فقط زوايا، لا تتداخل مع النص */
.float-cards {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.float-card {
  position: absolute;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
  padding: 12px 16px;
  color: #fff;
  display: flex; gap: 10px; align-items: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.40);
  font-size: .8rem; font-weight: 600;
  transform-style: preserve-3d;
  max-width: 220px;
}
.float-card i {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--grad-accent);
  display: grid; place-items: center; color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
}
/* انتشار حول الزوايا فقط - بعيداً عن منطقة النص */
.float-card.f1 { top: 18%;    left: -20px;  animation: floatA 8s ease-in-out infinite; }
.float-card.f2 { bottom: 28%; left: -10px;  animation: floatB 10s ease-in-out infinite; }
.float-card.f3 { bottom: 6%;  right: -16px; animation: floatA 9s ease-in-out infinite reverse; }
@keyframes floatA {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-14px) rotate(2deg); }
}
@keyframes floatB {
  0%, 100% { transform: translateY(0) rotate(3deg); }
  50%      { transform: translateY(16px) rotate(-2deg); }
}
/* إخفاء العائمات على الشاشات المتوسطة لتجنّب التداخل */
@media (max-width: 1280px) {
  .float-card.f2 { display: none; }
}
@media (max-width: 1024px) {
  .float-cards { display: none; }
}
/* تأكيد ظهور النص فوق العائمات */
.auth-side .pitch, .auth-side > a.brand, .auth-side > div:last-child {
  position: relative; z-index: 2;
}
.auth-side .brand-text .brand-title, .auth-side .brand-text .brand-sub { color: #fff; }
.auth-side .pitch h2 { color: #fff; font-size: 2rem; line-height: 1.3; }
.auth-side .pitch p { opacity: .9; max-width: 480px; }
.auth-side .quote {
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-inline-start: 4px solid var(--cyan-400);
  border: 1px solid rgba(255,255,255,.15);
  padding: 20px; border-radius: var(--radius);
  margin-top: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,.20);
}
.auth-main { display: grid; place-items: center; padding: 40px; }
.auth-card {
  background: #fff; padding: 40px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); width: min(440px, 100%);
  border-top: 4px solid var(--gold-500);
}
.auth-card h1 { font-size: 1.7rem; margin-bottom: 4px; }
.auth-tabs { display: flex; background: var(--green-50); padding: 4px; border-radius: 10px; margin-bottom: 26px; }
.auth-tabs button {
  flex: 1; padding: 10px; border: 0; background: transparent; cursor: pointer;
  font-weight: 700; color: var(--ink-700); border-radius: 8px; font-family: inherit;
}
.auth-tabs button.active { background: #fff; color: var(--green-800); box-shadow: var(--shadow-sm); }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; color: var(--ink-700); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff; font-family: inherit; font-size: .95rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-100);
}
.field .hint { font-size: .8rem; color: var(--ink-500); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-foot { margin-top: 16px; text-align: center; font-size: .9rem; color: var(--ink-500); }
.demo-creds {
  margin-top: 18px; padding: 12px; background: var(--gold-100);
  border: 1px dashed var(--gold-500); border-radius: var(--radius);
  font-size: .8rem; color: var(--ink-700);
}
.demo-creds b { color: var(--green-800); }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "side header"
    "side main";
  min-height: 100vh;
}
.app-header {
  grid-area: header;
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px; box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 20;
}
.app-header .search {
  flex: 1; max-width: 480px; position: relative;
}
.app-header .search input {
  width: 100%; padding: 10px 14px 10px 40px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); font-family: inherit;
}
.app-header .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-500); }
.app-header .actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; display: grid; place-items: center; cursor: pointer; position: relative;
  color: var(--ink-700);
}
.icon-btn:hover { background: var(--green-50); color: var(--green-800); }
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff; font-size: .65rem; font-weight: 800;
  border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center;
}
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px;
  border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer;
}
.user-chip:hover { border-color: var(--gold-500); }
.user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.user-chip .who { font-size: .85rem; line-height: 1.1; }
.user-chip .who b { color: var(--green-900); display: block; }
.user-chip .who span { color: var(--ink-500); font-size: .75rem; }

.app-sidebar {
  grid-area: side; background: var(--green-900); color: #fff;
  padding: 18px 0; overflow-y: auto;
}
.app-sidebar .brand {
  padding: 0 18px 18px; border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 14px;
}
.side-section { padding: 6px 12px; }
.side-section .title {
  padding: 8px 14px; color: var(--gold-400); font-size: .72rem;
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; opacity: .85;
}
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; color: rgba(255,255,255,.85);
  font-weight: 500; cursor: pointer; transition: all .15s ease;
  font-size: .95rem; position: relative;
}
.side-link i { width: 22px; text-align: center; color: var(--gold-400); font-size: .95rem; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.active {
  background: linear-gradient(135deg, var(--green-700), var(--green-800));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(212,175,55,.4);
}
.side-link.active::before {
  content: ''; position: absolute; right: -12px; top: 8px; bottom: 8px; width: 3px;
  background: var(--gold-500); border-radius: 4px;
}
.side-link .pill {
  margin-inline-start: auto; background: var(--gold-500); color: var(--green-900);
  font-size: .7rem; font-weight: 800; padding: 1px 8px; border-radius: 999px;
}

.app-main { grid-area: main; padding: 26px; overflow-x: hidden; }
.page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.page-head h1 { margin: 0 0 4px; font-size: 1.6rem; }
.page-head .crumbs { color: var(--ink-500); font-size: .85rem; }
.page-head .crumbs i { font-size: .7rem; margin: 0 6px; opacity: .6; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi-card {
  background: #fff; padding: 20px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; gap: 14px; align-items: center; transition: all .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gold-500); }
.kpi-icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--green-50); color: var(--green-700);
  display: grid; place-items: center; font-size: 1.4rem;
}
.kpi-card.gold .kpi-icon { background: var(--gold-100); color: var(--gold-700); }
.kpi-card.danger .kpi-icon { background: #fde8e6; color: var(--danger); }
.kpi-card.warn .kpi-icon { background: #fdf2dc; color: var(--warn); }
.kpi-card .kpi-val { font-size: 1.7rem; font-weight: 900; color: var(--green-900); line-height: 1; }
.kpi-card .kpi-label { font-size: .85rem; color: var(--ink-500); }
.kpi-card .kpi-delta { font-size: .8rem; margin-top: 4px; }
.kpi-card .kpi-delta.up { color: var(--ok); }
.kpi-card .kpi-delta.down { color: var(--danger); }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 18px;
}
.card .card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.card .card-head h3 { margin: 0; font-size: 1.1rem; }
.card .card-head .tools { display: flex; gap: 8px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  padding: 10px 16px; border: 0; background: transparent;
  font-family: inherit; font-weight: 600; color: var(--ink-500); cursor: pointer;
  position: relative; font-size: .95rem;
}
.tabs button.active { color: var(--green-800); }
.tabs button.active::after {
  content: ''; position: absolute; inset: auto 0 -1px 0; height: 3px;
  background: var(--gold-500); border-radius: 4px 4px 0 0;
}

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.data {
  width: 100%; border-collapse: collapse; background: #fff; font-size: .92rem;
}
table.data th, table.data td {
  padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data thead th {
  background: var(--green-50); color: var(--green-900); font-weight: 700;
  font-size: .85rem; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid var(--green-100);
}
table.data tbody tr:hover { background: var(--green-50); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .row-actions { display: flex; gap: 4px; }
table.data .row-actions button {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; color: var(--ink-700);
}
table.data .row-actions button:hover { background: var(--green-50); color: var(--green-800); border-color: var(--green-500); }
table.data .row-actions button.danger:hover { background: #fde8e6; color: var(--danger); border-color: var(--danger); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: .78rem;
  font-weight: 700; background: var(--green-50); color: var(--green-800);
  border: 1px solid var(--green-100);
}
.chip.gold   { background: var(--gold-100); color: var(--gold-700); border-color: #f0e3a8; }
.chip.danger { background: #fde8e6; color: var(--danger); border-color: #fbcfca; }
.chip.warn   { background: #fdf2dc; color: var(--warn);   border-color: #f7e0a8; }
.chip.info   { background: #e7f0ff; color: var(--info);   border-color: #c2d8fb; }
.chip.muted  { background: var(--ink-100); color: var(--ink-700); border-color: var(--ink-100); }
.chip.ok     { background: #e2f5e7; color: var(--ok);     border-color: #b6e3c1; }

.toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px; padding: 14px; background: var(--green-50);
  border-radius: var(--radius); border: 1px solid var(--green-100);
}
.toolbar input, .toolbar select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; background: #fff; min-width: 180px;
}
.toolbar .grow { flex: 1; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(11,27,22,.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: min(720px, 100%);
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--gold-500);
}
.modal.lg { width: min(1000px, 100%); }
.modal-head {
  padding: 18px 22px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2;
}
.modal-head h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-foot {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-start; gap: 10px;
  position: sticky; bottom: 0; background: #fff;
}
.close-x {
  width: 32px; height: 32px; border-radius: 8px; border: 0;
  background: var(--bg); cursor: pointer; color: var(--ink-700);
}
.close-x:hover { background: #fde8e6; color: var(--danger); }

/* Notification toast */
.toasts { position: fixed; top: 20px; left: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff; border-inline-start: 4px solid var(--green-700);
  padding: 14px 18px; border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 280px; display: flex; gap: 10px; align-items: center;
  animation: slide-in .3s ease;
}
.toast.success { border-color: var(--ok); }
.toast.error { border-color: var(--danger); }
.toast.warn { border-color: var(--warn); }
.toast i { font-size: 1.2rem; color: var(--green-700); }
.toast.success i { color: var(--ok); }
.toast.error i { color: var(--danger); }
.toast.warn i { color: var(--warn); }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.notif-panel {
  position: absolute; top: 56px; right: 16px; width: min(380px, 95vw);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: none; z-index: 30; overflow: hidden;
}
.notif-panel.open { display: block; }
.notif-panel .head { padding: 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-panel .list { max-height: 400px; overflow-y: auto; }
.notif-item {
  padding: 14px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; cursor: pointer;
}
.notif-item:hover { background: var(--green-50); }
.notif-item.unread { background: #fffbe6; border-inline-start: 3px solid var(--gold-500); }
.notif-item i { width: 36px; height: 36px; border-radius: 50%; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; flex-shrink: 0; }
.notif-item .body { flex: 1; }
.notif-item .body b { display: block; font-size: .9rem; color: var(--green-900); }
.notif-item .body span { font-size: .8rem; color: var(--ink-500); }
.notif-item time { font-size: .7rem; color: var(--ink-500); }

/* Charts container */
.chart-wrap { position: relative; height: 280px; }

/* Empty State */
.empty {
  text-align: center; padding: 40px 20px; color: var(--ink-500);
}
.empty i { font-size: 3rem; color: var(--ink-300); margin-bottom: 12px; display: block; }
.empty h4 { color: var(--ink-700); margin: 6px 0 4px; }

/* Two column / Grid utilities */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-12 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-21 { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }

@media (max-width: 1024px) {
  .app { grid-template-columns: 70px 1fr; }
  .app-sidebar .side-link span,
  .app-sidebar .side-section .title,
  .app-sidebar .brand-text { display: none; }
  .app-sidebar .side-link { justify-content: center; }
  .app-sidebar .side-link i { width: auto; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-12, .grid-21, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .app { grid-template-columns: 56px 1fr; grid-template-rows: 56px 1fr; }
  .app-sidebar { padding: 12px 0; }
  .app-sidebar .brand { padding: 0 6px 12px; }
  .app-sidebar .brand-mark { width: 40px; height: 40px; }
  .app-header { padding: 0 12px; gap: 8px; }
  .app-header .search { display: none; }
  .app-header .actions { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; }
  .user-chip { padding: 4px 8px 4px 4px; }
  .user-chip .who { display: none; }
  .app-main { padding: 12px; }
  .kpi-grid { grid-template-columns: 1fr; gap: 10px; }
  .kpi-card { padding: 14px; }
  .kpi-card .kpi-val { font-size: 1.4rem; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head h1 { font-size: 1.3rem; }
  .field-row { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input, .toolbar select { width: 100%; }
  .card { padding: 14px; }
  .card .card-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .modal { max-height: 92vh; }
  .modal-body, .modal-head, .modal-foot { padding: 14px; }
  .modal-foot { flex-direction: column; }
  .modal-foot .btn { width: 100%; justify-content: center; }
  table.data { font-size: .82rem; }
  table.data th, table.data td { padding: 8px 10px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs button { white-space: nowrap; flex-shrink: 0; }
  .auth-card { padding: 26px 20px; }
  .auth-card h1 { font-size: 1.4rem; }
  .cal-day { min-height: 60px; padding: 4px; }
  .cal-day .num { font-size: .75rem; }
  .cal-event { font-size: .65rem; padding: 1px 4px; }
  .cal-day-name { font-size: .72rem; padding: 6px 2px; }
}

/* Calendar */
.calendar { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 20px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cal-head h3 { margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-day-name { background: var(--green-50); color: var(--green-800); text-align: center; padding: 10px; font-weight: 700; font-size: .85rem; }
.cal-day { background: #fff; min-height: 90px; padding: 8px; cursor: pointer; transition: all .15s; }
.cal-day:hover { background: var(--green-50); }
.cal-day.other-month { background: var(--bg); color: var(--ink-300); }
.cal-day.today { background: var(--gold-100); }
.cal-day .num { font-weight: 700; font-size: .85rem; color: var(--green-900); margin-bottom: 4px; }
.cal-day.today .num { color: var(--gold-700); }
.cal-event {
  font-size: .72rem; background: var(--green-700); color: #fff;
  padding: 2px 6px; border-radius: 4px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-event.gold { background: var(--gold-600); }
.cal-event.danger { background: var(--danger); }
.cal-event.info { background: var(--info); }

/* Timeline */
.timeline { position: relative; padding-inline-start: 22px; margin: 10px 0; }
.timeline::before {
  content: ''; position: absolute; top: 4px; bottom: 4px; right: 6px; width: 2px;
  background: var(--green-100);
}
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: ''; position: absolute; right: -1px; top: 5px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--gold-500); border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--gold-500);
}
.timeline-item time { color: var(--ink-500); font-size: .8rem; }
.timeline-item b { display: block; color: var(--green-900); margin: 2px 0; }

/* Chat */
.chat-wrap { display: flex; flex-direction: column; height: 460px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg); }
.msg { max-width: 70%; padding: 10px 14px; border-radius: 14px; margin-bottom: 10px; font-size: .9rem; line-height: 1.4; }
.msg.in { background: #fff; border: 1px solid var(--border); margin-inline-start: 0; }
.msg.out { background: var(--green-700); color: #fff; margin-inline-start: auto; }
.msg time { display: block; font-size: .7rem; opacity: .7; margin-top: 4px; }
.chat-input { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-input input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 22px; font-family: inherit; }

/* Status dot */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); margin-inline-end: 6px; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }

/* Print */
@media print {
  .app-sidebar, .app-header, .toolbar, .row-actions { display: none !important; }
  .app { grid-template-columns: 1fr; grid-template-areas: "main"; }
  .app-main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
