/* public_html/admin/assets/css/admin.css
 * Admin panel base styles (Step 1+)
 * - Auth + Panel layout + Dashboard + Table
 * - Vazirmatn font: /admin/assets/fonts/Vazirmatn-Regular.ttf (+ optional Bold/ExtraBold)
 */

@font-face{
  font-family:"Vazirmatn";
  src:url("../fonts/Vazirmatn-Regular.ttf") format("truetype");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}

@font-face{
  font-family:"Vazirmatn";
  src:url("../fonts/Vazirmatn-Bold.ttf") format("truetype");
  font-weight:700;
  font-style:normal;
  font-display:swap;
}

@font-face{
  font-family:"Vazirmatn";
  src:url("../fonts/Vazirmatn-ExtraBold.ttf") format("truetype");
  font-weight:800;
  font-style:normal;
  font-display:swap;
}

:root{
  color-scheme: light dark;

  --font-sans: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Arial, sans-serif;

  --bg0:#070b14;
  --bg1:#0b1220;

  --card:rgba(18,28,54,.84);
  --cardSoft:rgba(255,255,255,.06);
  --border:rgba(255,255,255,.14);
  --border2:rgba(255,255,255,.10);

  --fg:#eef3ff;
  --muted:rgba(238,243,255,.70);

  --primary:#7c5cff;
  --primary2:#4f8cff;

  --ok:#22c55e;
  --warn:#f59e0b;
  --err:#ef4444;
  --info:#3b82f6;

  --r12:12px;
  --r16:16px;
  --r20:20px;
  --r24:24px;

  --shadow: 0 18px 60px rgba(0,0,0,.48);
  --shadow2: 0 10px 28px rgba(0,0,0,.35);

  --ring: 0 0 0 4px rgba(124,92,255,.18);
  --ring2: 0 0 0 6px rgba(79,140,255,.14);

  --sidebar-w: 292px;
  --topbar-h: 66px;

  /* spacing (fix overlaps / tighter layout) */
  --gap: 16px;
  --gap2: 20px;
}

*{box-sizing:border-box}
html,body{height:100%}
html{
  font-family:var(--font-sans);
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Direction safety (prevent accidental LTR for Persian) */
html[dir="rtl"]{ direction: rtl; }
html[dir="ltr"]{ direction: ltr; }

body{
  margin:0;
  font-family:var(--font-sans);
  line-height:1.65;
  background:
    radial-gradient(900px 520px at 14% 8%, rgba(124,92,255,.38), transparent 62%),
    radial-gradient(860px 520px at 86% 18%, rgba(79,140,255,.30), transparent 62%),
    radial-gradient(980px 680px at 50% 112%, rgba(34,197,94,.14), transparent 62%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 72%);
  color:var(--fg);
  overflow-x:hidden;
}
html[dir="rtl"] body{ text-align: right; }
html[dir="ltr"] body{ text-align: left; }

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size:22px 22px;
  opacity:.22;
  mix-blend-mode:overlay;
}

a{color:inherit}
a{text-decoration:none}
a:hover{text-decoration:none}

/* Utility: force LTR islands for english/ids */
.nf-ltr{
  direction:ltr;
  text-align:left;
  unicode-bidi:isolate;
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
}
.nf-rtl{
  direction:rtl;
  text-align:right;
  unicode-bidi:isolate;
}

code{
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:12px;
  padding:2px 6px;
  border:1px solid var(--border2);
  border-radius:999px;
  background:rgba(255,255,255,.04);
}

/* Focus ring */
:focus-visible{
  outline:none;
  box-shadow: var(--ring2);
  border-radius: 12px;
}

/* ---------------------------------------
 * Buttons + inputs (shared)
 * ------------------------------------- */
.nf-input{
  width:100%;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(10,16,32,.52);
  color:var(--fg);
  outline:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  font-family:var(--font-sans);
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease, background .14s ease;
}
.nf-input:focus{
  border-color: rgba(124,92,255,.58);
  box-shadow: var(--ring), inset 0 1px 0 rgba(255,255,255,.06);
  background: rgba(10,16,32,.58);
}
.nf-input::placeholder{color:rgba(238,243,255,.42)}
.nf-input:disabled{opacity:.6; cursor:not-allowed}

.nf-btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:var(--fg);
  padding:11px 18px;
  border-radius:16px;
  font-weight:800;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;
  box-shadow: var(--shadow2);
  font-family:var(--font-sans);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  max-width:100%;
}
.nf-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
}
.nf-btn:active{transform: translateY(0)}
.nf-btn:disabled{opacity:.55; cursor:not-allowed; transform:none}

.nf-btn--primary{
  border-color: rgba(124,92,255,.60);
  background: linear-gradient(135deg, rgba(124,92,255,.96), rgba(79,140,255,.88));
  min-width:180px;
}
.nf-btn--primary:hover{
  box-shadow: 0 18px 46px rgba(124,92,255,.22);
  filter: saturate(1.06);
}
.nf-btn--primary:focus-visible{
  box-shadow: var(--ring2), 0 18px 46px rgba(124,92,255,.22);
}

.nf-btn--ghost{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
  box-shadow: none;
}
.nf-btn--ghost:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.20);
}

.nf-iconbtn{
  width:44px;
  height:44px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:var(--fg);
  cursor:pointer;
  font-family:var(--font-sans);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}
.nf-iconbtn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
}
.nf-iconbtn:active{transform: translateY(0)}
.nf-iconbtn:focus-visible{
  box-shadow: var(--ring2), 0 10px 24px rgba(0,0,0,.28);
}
.nf-eye{font-size:16px}

/* Burger icon (used in topbar + sidebar) */
.nf-burger{
  width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;position:relative;
}
.nf-burger::before,
.nf-burger::after,
.nf-burger > span{
  content:"";
  position:absolute;
  left:2px; right:2px;
  height:2px;
  border-radius:999px;
  background: rgba(238,243,255,.90);
  transition: transform .16s ease, opacity .16s ease, top .16s ease;
}
.nf-burger::before{ top:5px; }
.nf-burger > span{ top:8px; }
.nf-burger::after{ top:11px; }

/* ---------------------------------------
 * Auth layout
 * ------------------------------------- */
.nf-auth__wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:28px 16px;
}

.nf-auth__card{
  width:min(470px, 100%);
  border-radius:var(--r24);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  overflow:hidden;
  position:relative;
  backdrop-filter: blur(10px);
}

.nf-auth__card::before{
  content:"";
  position:absolute;
  inset:-3px;
  background: linear-gradient(120deg, rgba(124,92,255,.40), rgba(79,140,255,.26), rgba(34,197,94,.14));
  filter: blur(18px);
  opacity:.33;
  pointer-events:none;
}

.nf-auth__card::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  background: linear-gradient(180deg, rgba(255,255,255,.08), transparent 40%, rgba(0,0,0,.20));
  opacity:.55;
}

.nf-auth__card > *{ position:relative; z-index:1; }

.nf-auth__head{ padding:24px 24px 8px; }
.nf-auth__title{
  margin:0;
  font-size:20px;
  font-weight:900;
  letter-spacing:.15px;
}
.nf-auth__hint{
  margin-top:6px;
  font-size:12.5px;
  color:var(--muted);
}

.nf-auth__toasts{ padding:0 24px 10px; }

/* toast.php injects a <style> later; override with !important for auth */
.nf-auth .nf-auth__card #nf_toasts{
  position:static !important;
  inset:auto !important;
  z-index:auto !important;
  max-width:100% !important;
  display:flex !important;
  flex-direction:column !important;
  gap:10px !important;
}
.nf-auth .nf-auth__card #nf_toasts .nf-toast{
  max-width:100% !important;
  border-radius:16px;
}

.nf-form{
  padding:14px 24px 24px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.nf-field{display:flex;flex-direction:column;gap:7px}
.nf-label{
  font-size:12.5px;
  color:rgba(238,243,255,.88);
  font-weight:800;
}
.nf-help{
  font-size:12px;
  color:rgba(238,243,255,.62);
}
.nf-inputwrap{ display:flex; align-items:center; gap:10px; }
.nf-inputwrap .nf-input{ flex:1; }
.nf-row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  margin-top:6px;
}

/* ---------------------------------------
 * Toasts (global default)
 * ------------------------------------- */
#nf_toasts{position:fixed; inset:auto 16px 16px auto; z-index:9999}
.nf-toast{
  border-radius:16px;
  padding:12px 12px 10px;
  background:rgba(16,26,51,.96);
  border:1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 34px rgba(0,0,0,.38);
  color:var(--fg);
  max-width:min(420px, calc(100vw - 32px));
}
.nf-toast .ttl{font-weight:900;font-size:13px;margin:0 0 6px}
.nf-toast .msg{margin:0;font-size:13px;color:rgba(238,243,255,.86);line-height:1.65}
.nf-toast.success{border-color:rgba(34,197,94,.30)}
.nf-toast.error{border-color:rgba(239,68,68,.30)}
.nf-toast.warning{border-color:rgba(245,158,11,.30)}
.nf-toast.info{border-color:rgba(59,130,246,.30)}

/* ---------------------------------------
 * Admin Panel layout (admin_layout.php)
 * ------------------------------------- */
.nf-skip{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.nf-skip:focus{
  left:16px;
  top:16px;
  width:auto;height:auto;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  z-index: 999999;
}

.nf-shell{
  display:flex;
  min-height:100vh;
  width:100%;
}

.nf-sidebar{
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-inline-end:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.18));
  backdrop-filter: blur(10px);
}

.nf-body{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}

.nf-topbar{
  height: var(--topbar-h);
  border-bottom:1px solid rgba(255,255,255,.10);
  background: rgba(11,18,32,.58);
  backdrop-filter: blur(10px);
}

.nf-topbar__inner{
  height:100%;
  padding: 12px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.nf-topbar__left, .nf-topbar__right{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.nf-topbar__left{ flex:1; }
.nf-topbar__right{ flex:0 0 auto; }

.nf-topbar__menubtn{ display:none; }

.nf-main{
  padding: 18px;
  flex:1;
  min-height:0;
}
.nf-content{
  margin-top: var(--gap);
  min-width:0;
}

/* Page header area (optional in layout) */
.nf-pagehead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding: 14px 16px;
  border-radius: var(--r20);
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 28px rgba(0,0,0,.26);
  margin-bottom: var(--gap);
}
.nf-pagehead__left{ min-width:0; }
.nf-h1{
  margin:0;
  font-size:18px;
  font-weight:900;
  letter-spacing:.1px;
}
.nf-subtitle{
  margin-top:6px;
  font-size:12.5px;
  color: rgba(238,243,255,.70);
}

/* Breadcrumbs */
.nf-bc{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
}
.nf-bc__item{
  font-size:12.5px;
  color: rgba(238,243,255,.82);
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 50vw;
}
.nf-bc__item a{
  color: rgba(238,243,255,.86);
  border-bottom: 1px dashed rgba(255,255,255,.18);
}
.nf-bc__item a:hover{
  border-bottom-color: rgba(255,255,255,.34);
}
.nf-bc__sep{
  opacity:.45;
  font-size:12px;
}

/* Sidebar inner */
.nf-sidebar__inner{
  display:flex;
  flex-direction:column;
  height:100%;
  padding: 14px;
  gap:12px;
}

.nf-sidebar__brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 10px;
  border-radius: var(--r20);
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
}

.nf-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.nf-brand__dot{
  width:12px;height:12px;border-radius:999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(124,92,255,.9));
  box-shadow: 0 0 0 4px rgba(124,92,255,.12);
}
.nf-brand__text{
  font-weight:900;
  font-size:13px;
  letter-spacing:.1px;
  opacity:.95;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width: 180px;
}

/* Nav */
.nf-nav{ display:flex; flex-direction:column; gap:10px; padding: 4px 2px; } /* gap increased */
.nf-nav__item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(238,243,255,.88);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.nf-nav__item:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
}
.nf-nav__item.is-active{
  border-color: rgba(124,92,255,.40);
  background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(79,140,255,.12));
  box-shadow: 0 12px 34px rgba(0,0,0,.22);
}
.nf-ico{ fill:none; stroke: rgba(238,243,255,.78); stroke-width:1.7; }
.nf-nav__item.is-active .nf-ico{ stroke: rgba(238,243,255,.92); }

/* label must be flexible to keep badge + chevron aligned */
.nf-nav__label{
  font-size:13px;
  font-weight:800;
  flex: 1 1 auto;
  min-width:0;
}

/* badge (sidebar counters) */
.nf-nav__badge,
#nfBadgeAdminTickets{
  flex: 0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 7px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  line-height:1;
  margin-inline-start:10px;

  background: rgba(239,68,68,.22);
  border: 1px solid rgba(239,68,68,.52);
  color: rgba(255,255,255,.94);
  box-shadow: 0 10px 22px rgba(239,68,68,.16);
}
.nf-nav__badge.is-hidden,
#nfBadgeAdminTickets.is-hidden{
  display:none !important;
}

/* chevron should not stretch */
.nf-nav__chev{
  flex: 0 0 auto;
  opacity:.60;
}

/* Sidebar footer */
.nf-sidebar__footer{
  margin-top:auto;
  padding-top: 10px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.nf-miniuser{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.nf-miniuser__avatar{
  width:34px;height:34px;border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,92,255,.40), rgba(79,140,255,.22));
  border:1px solid rgba(255,255,255,.12);
}
.nf-miniuser__meta{ min-width:0; }
.nf-miniuser__name{
  font-weight:900;
  font-size:12.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 190px;
}
.nf-miniuser__sub{
  font-size:12px;
  color: rgba(238,243,255,.62);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 190px;
}

/* Close button in sidebar (exists in admin_layout.php) */
.nf-sidebar__close{
  display:none;
  margin: 12px;
}

/* ---------------------------------------
 * Footer (fix: centered + complete copyright + RTL/LTR safe)
 * ------------------------------------- */
.nf-footer{
  padding: 14px 18px 22px;
}

.nf-footer__inner{
  display:flex;
  align-items:center;
  justify-content:center;            /* مرکز صفحه */
  gap:12px 18px;
  flex-wrap:wrap;
  padding: 14px 16px;
  border-radius: var(--r20);
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
  text-align:center;
}

.nf-footer__inner > div{
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}

@media (max-width: 520px){
  .nf-footer__inner > div{
    white-space:normal;
  }
}

/* اگر داخل فوتر متن انگلیسی/عدد/ID بود، جدا و درست نمایش بده */
.nf-footer__inner .nf-ltr{
  direction:ltr;
  text-align:left;
  unicode-bidi:isolate;
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
}

/* ---------------------------------------
 * Dashboard cards (dashboard view)
 * ------------------------------------- */
.nf-card{
  border-radius: var(--r24);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.12));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 60px rgba(0,0,0,.30);
  padding: 16px;
  min-width:0;              /* prevents overflow overlap */
  overflow:hidden;           /* prevents internal overlap */
}
.nf-card__head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
  flex-wrap:wrap;            /* fix: titles/subs can wrap instead of overlap */
}
.nf-card__ttl{
  font-weight:900;
  font-size:13px;
  opacity:.95;
}
.nf-card__sub{
  font-size:12px;
  color: rgba(238,243,255,.62);
  max-width:100%;
}

.nf-card__val{
  font-size:22px;
  font-weight:900;
  letter-spacing:.2px;
  margin-top: 8px;
}
.nf-card__val.is-ok{ color: rgba(34,197,94,.95); }
.nf-card__val.is-err{ color: rgba(239,68,68,.95); }
.nf-card__hint{
  margin-top: 6px;
  font-size:12px;
  color: rgba(238,243,255,.62);
}

.nf-dashboard__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;

  /* FIX: جلوی افتادن نوار بازه داخل کارت بالایی را می‌گیرد */
  margin-top: var(--gap);

  /* فاصله از سکشن بعدی */
  margin-bottom: var(--gap);

  position:relative;
  z-index:2;
}

.nf-range{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;

  /* FIX: اگر متن/دکمه‌ها طولانی شد، به‌جای هل دادن به داخل کارت‌ها، جمع‌وجور بماند */
  max-width:100%;
}
.nf-range__label{
  font-size:12px;
  color: rgba(238,243,255,.65);
  font-weight:800;
}
.nf-range__btn{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  font-size:12px;
  font-weight:900;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.nf-range__btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.16);
}
.nf-range__btn.is-active{
  border-color: rgba(124,92,255,.45);
  background: linear-gradient(135deg, rgba(124,92,255,.20), rgba(79,140,255,.10));
}

.nf-kpi{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);            /* increased */
  margin: var(--gap) 0;       /* increased */
}
.nf-kpi__card{ grid-column: span 12; }
@media (min-width: 720px){
  .nf-kpi__card{ grid-column: span 6; }
}
@media (min-width: 1020px){
  .nf-kpi__card{ grid-column: span 4; }
}

.nf-grid2{
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--gap);            /* increased */
  margin-top: var(--gap);     /* increased */
}
@media (min-width: 980px){
  .nf-grid2{ grid-template-columns: 1.2fr .8fr; }
}

.nf-emptybox{
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
  color: rgba(238,243,255,.68);
  font-size:12.5px;
}

/* Bars */
.nf-bars{ display:flex; flex-direction:column; gap:12px; } /* increased */
.nf-bar{ padding: 10px 12px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.nf-bar__meta{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; } /* wrap fix */
.nf-bar__label{ font-weight:900; font-size:12.5px; }
.nf-bar__value{ font-size:12px; color: rgba(238,243,255,.70); }
.nf-bar__track{
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.nf-bar__fill{
  height:100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124,92,255,.92), rgba(79,140,255,.78));
  box-shadow: 0 8px 22px rgba(124,92,255,.18);
}

/* UTM pills */
.nf-utm{ display:grid; grid-template-columns: 1fr; gap: var(--gap); } /* increased */
@media (min-width: 720px){
  .nf-utm{ grid-template-columns: 1fr 1fr; }
}
.nf-minihead{
  font-size:12px;
  font-weight:900;
  opacity:.9;
  margin-bottom: 8px;
}
.nf-pill{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  margin-bottom: 10px; /* slightly more */
}
.nf-pill .k{
  font-size:12px;
  font-weight:900;
  opacity:.9;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.nf-pill .v{ font-size:12px; color: rgba(238,243,255,.72); font-weight:900; }

/* Full-width card helper */
.nf-card--full{ margin-top: var(--gap2); } /* increased */

/* ---------------------------------------
 * Table (table.php partial)
 * ------------------------------------- */
.nf-tablewrap{
  width:100%;
  overflow:auto;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.nf-table{
  width:100%;
  border-collapse: collapse;
  min-width: 720px; /* a bit safer for dashboard tables */
}
.nf-table thead th{
  position:sticky;
  top:0;
  background: rgba(11,18,32,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.10);
  z-index: 1;
}
.nf-th, .nf-td{
  padding: 12px 12px;
  text-align: start;
  font-size:12.5px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: rgba(238,243,255,.86);
  vertical-align: middle; /* fixes awkward row alignment */
}
.nf-th{
  font-weight:900;
  color: rgba(238,243,255,.92);
}
.nf-td{ color: rgba(238,243,255,.82); }
.nf-th.is-nowrap, .nf-td.is-nowrap{ white-space:nowrap; }
.nf-table tbody tr:hover{
  background: rgba(255,255,255,.035);
}
.nf-empty{
  padding: 18px 12px;
  text-align:center;
  color: rgba(238,243,255,.62);
}

/* ---------------------------------------
 * Mobile sidebar (off-canvas)
 * ------------------------------------- */
.nf-overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.52);
  backdrop-filter: blur(2px);
  opacity:0;
  pointer-events:none;
  transition: opacity .16s ease;
  z-index: 9998;
}

@media (max-width: 980px){
  :root{ --gap: 12px; --gap2: 16px; }

  .nf-topbar__menubtn{ display:inline-flex; }

  .nf-topbar{ height: 62px; }
  .nf-topbar__inner{ padding: 10px 12px; }
  .nf-main{ padding: 12px; }

  .nf-pagehead{ padding: 12px 12px; }
  .nf-h1{ font-size:16px; }
  .nf-subtitle{ font-size:12px; }

  .nf-card{ padding: 12px; border-radius: var(--r20); }
  .nf-card__val{ font-size:18px; }
  .nf-card__ttl{ font-size:12.5px; }
  .nf-card__sub{ font-size:11.5px; }

  /* Sidebar fully hidden until burger click (no half-visible state) */
  .nf-sidebar{
    position:fixed;
    top:0;
    bottom:0;

    left:0;                /* fallback for browsers without logical props */
    right:auto;

    inset-inline-start:0;
    width: min(var(--sidebar-w), 92vw);

    transform: translate3d(-110%, 0, 0);
    transition: transform .18s ease, opacity .18s ease, visibility .18s ease;

    z-index: 9999;

    opacity:0;
    visibility:hidden;
    pointer-events:none;

    overflow:hidden;
  }

  /* RTL: slide from right with physical fallback */
  html[dir="rtl"] .nf-sidebar{
    left:auto;
    right:0;

    inset-inline-start:auto;
    inset-inline-end:0;

    transform: translate3d(110%, 0, 0);
  }

  body.nf-sidebar-open .nf-sidebar{
    transform: translate3d(0, 0, 0);
    opacity:1;
    visibility:visible;
    pointer-events:auto;
  }

  body.nf-sidebar-open{
    overflow:hidden; /* prevent background scroll */
  }

  body.nf-sidebar-open .nf-overlay{
    opacity:1;
    pointer-events:auto;
  }

  /* Close button fixed place; never cover links */
  .nf-sidebar__close{
    display:inline-flex;
    position:absolute;
    top:12px;

    right:12px;            /* fallback */
    left:auto;

    inset-inline-end:12px;

    margin:0;
    z-index:2;
  }
  html[dir="rtl"] .nf-sidebar__close{
    left:12px;
    right:auto;
  }

  /* Sidebar scroll + spacing for close button */
  .nf-sidebar__inner{
    height:100%;
    overflow:auto;
    padding-top: 64px;
    -webkit-overflow-scrolling: touch;
  }

  /* Desktop parity: keep same column logic on mobile (no collapse) */
  .nf-kpi__card{ grid-column: span 4; }            /* 3 cards per row */
  .nf-grid2{ grid-template-columns: 1.2fr .8fr; }  /* 2 columns */
  .nf-utm{ grid-template-columns: 1fr 1fr; }       /* 2 columns */
}

/* Small screens */
@media (max-width: 420px){
  .nf-auth__head{padding:20px 18px 6px}
  .nf-auth__toasts{padding:0 18px 10px}
  .nf-form{padding:12px 18px 18px}
  .nf-btn--primary{min-width: 100%}
  .nf-main{ padding: 14px; }

  :root{ --gap: 10px; --gap2: 14px; }
  .nf-card{ padding: 10px; }
  .nf-card__val{ font-size:16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto}
  .nf-btn, .nf-iconbtn, .nf-input, .nf-sidebar, .nf-overlay{transition:none}
  body::before{opacity:.14}
}
