/* TecniForge Admin Portal - custom layer on top of the real Shreyu theme CSS.
   Shreyu (shreyu.css) provides Bootstrap + all components, colors and typography.
   This file only lays out the app shell and maps the app's wrapper classes to
   Shreyu's flat card look, using Shreyu's own CSS variables. */

/* white page background (override Shreyu's grey #f3f4f7) */
:root{--bs-main-body-bg:#ffffff}
body{background:#ffffff!important;color:var(--bs-body-color);font-family:var(--bs-font-sans-serif)}
:root[data-bs-theme="dark"] body{background:var(--bs-body-bg)!important}

/* ---- Topbar (Shreyu: white, full width, 70px) ---- */
.tf-topbar{position:fixed;top:0;left:0;right:0;height:var(--bs-topbar-height);background:var(--bs-topbar-bg);
  border-bottom:1px solid var(--bs-border-color);z-index:1001;display:flex;align-items:center}
.tf-logobox{width:var(--bs-sidenav-width);min-width:var(--bs-sidenav-width);height:100%;display:flex;align-items:center;gap:10px;padding:0 24px;border-right:1px solid var(--bs-border-color)}
.tf-topbar .bar{flex:1;display:flex;align-items:center;justify-content:space-between;padding:0 24px}
.tf-topbar .title{font-weight:600;font-size:18px;color:var(--bs-emphasis-color)}
.tf-topbar .title small{display:block;font-weight:400;font-size:12.5px;color:var(--bs-secondary-color)}
.tf-top-actions{display:flex;align-items:center;gap:8px}
.tf-icon-btn{width:40px;height:40px;border-radius:.25rem;border:1px solid var(--bs-border-color);background:transparent;color:var(--bs-secondary-color);display:flex;align-items:center;justify-content:center;cursor:pointer}
.tf-icon-btn:hover{color:var(--bs-primary);border-color:var(--bs-primary)}
.tf-avatar{width:38px;height:38px;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:13px}

/* ---- Sidebar (Shreyu left-side-menu) ---- */
.tf-sidebar{position:fixed;top:var(--bs-topbar-height);bottom:0;left:0;width:var(--bs-sidenav-width);
  background:var(--bs-menu-bg);border-right:1px solid var(--bs-border-color);overflow-y:auto;z-index:1000;padding:12px 0}
.tf-sidebar::-webkit-scrollbar{width:6px}.tf-sidebar::-webkit-scrollbar-thumb{background:rgba(152,166,173,.3);border-radius:3px}
.tf-nav{padding:0 8px}
.tf-nav .cat{color:#adb5bd;font-size:.7rem;letter-spacing:.05em;text-transform:uppercase;font-weight:600;padding:16px 15px 8px}
.tf-nav a{display:flex;align-items:center;gap:12px;color:var(--bs-menu-item-color);font-size:var(--bs-menu-item-font-size,15px);padding:8px 15px;border-radius:4px;margin:2px 5px;font-weight:400;transition:.15s}
.tf-nav a i{width:20px;text-align:center;font-size:18px;color:var(--bs-menu-item-color);opacity:.85}
.tf-nav a:hover{color:var(--bs-menu-item-hover-color,var(--bs-primary))}
.tf-nav a:hover i{color:var(--bs-primary);opacity:1}
.tf-nav a.active{color:var(--bs-menu-item-active-color);background:var(--bs-menu-item-active-bg);font-weight:600}
.tf-nav a.active i{color:var(--bs-menu-item-active-color);opacity:1}

/* ---- Main / content ---- */
.tf-main{margin-left:var(--bs-sidenav-width);padding-top:var(--bs-topbar-height);min-height:100vh;display:flex;flex-direction:column}
.tf-content{padding:24px;flex:1}

/* ---- Cards = Shreyu flat card ---- */
.tf-card{background:var(--bs-body-bg);border:1px solid var(--bs-border-color);border-radius:var(--bs-border-radius);margin-bottom:24px}
.tf-card .hd{padding:.85rem 1.5rem;border-bottom:1px solid var(--bs-border-color);display:flex;align-items:center;justify-content:space-between}
.tf-card .hd h5{margin:0;font-size:15px;font-weight:600;color:var(--bs-emphasis-color)}
.tf-card .bd{padding:1.5rem}

/* ---- Stat tiles (Shreyu widget) ---- */
.tf-stat{background:var(--bs-body-bg);border:1px solid var(--bs-border-color);border-radius:var(--bs-border-radius);padding:1.5rem;height:100%}
.tf-stat .ic{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:20px;color:#fff;margin-bottom:14px}
.tf-stat .lbl{color:var(--bs-secondary-color);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.03em}
.tf-stat .val{font-size:24px;font-weight:700;color:var(--bs-emphasis-color);margin-top:3px;line-height:1.1}
.tf-stat .sub{font-size:12px;color:var(--bs-secondary-color);margin-top:4px}
.tf-stat.g1 .ic{background:var(--bs-primary)}
.tf-stat.g2 .ic{background:var(--bs-success)}
.tf-stat.g3 .ic{background:var(--bs-warning)}
.tf-stat.g4 .ic{background:var(--bs-info)}
.tf-stat.g5 .ic{background:var(--bs-danger)}

/* ---- Ribbon ---- */
.tf-ribbon{background:linear-gradient(135deg,var(--bs-primary),#6f82ff);border-radius:var(--bs-border-radius);padding:22px 26px;color:#fff;position:relative;overflow:hidden}
.tf-ribbon::after{content:"";position:absolute;right:-40px;top:-40px;width:200px;height:200px;border-radius:50%;background:rgba(255,255,255,.08)}
.tf-ribbon h3{margin:0;font-weight:700}
.tf-ribbon .crown{color:#ffe082}

.tf-ava{width:36px;height:36px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-weight:600;font-size:12px}

/* map existing button classes to Shreyu primary/dark */
.btn-gold{background:var(--bs-primary);border:1px solid var(--bs-primary);color:#fff}
.btn-gold:hover{background:#3f55e0;border-color:#3f55e0;color:#fff}
.btn-navy{background:var(--bs-dark);border:none;color:#fff}.btn-navy:hover{filter:brightness(1.1);color:#fff}

/* ---- Login ---- */
.tf-login{min-height:100vh;display:flex;align-items:center;justify-content:center;background:var(--bs-main-body-bg);padding:20px}
.tf-login .box{width:100%;max-width:420px;background:var(--bs-body-bg);border:1px solid var(--bs-border-color);border-radius:.4rem;padding:38px}
.tf-login .logo{margin:0 auto 14px;text-align:center}

@media(max-width:991px){
  .tf-logobox{width:auto;min-width:auto;border-right:none}
  .tf-sidebar{transform:translateX(-100%);transition:.2s}
  .tf-sidebar.open{transform:none}
  .tf-main{margin-left:0}
}
.tf-overlay{display:none}
@media(max-width:991px){.tf-overlay.show{display:block;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:999}}

/* ===== Top primary nav + side sub-menu (v1.17) ===== */
:root{--tf-topnav-h:46px}
.tf-topnav{position:fixed;top:var(--bs-topbar-height);left:0;right:0;height:var(--tf-topnav-h);z-index:1001;
  background:var(--bs-topbar-bg,#fff);border-bottom:1px solid var(--bs-border-color);
  display:flex;align-items:stretch;gap:2px;padding:0 10px;overflow-x:auto;overflow-y:hidden;white-space:nowrap}
.tf-topnav::-webkit-scrollbar{height:0}
.tf-top-link{display:inline-flex;align-items:center;padding:0 14px;font-size:14px;font-weight:600;
  color:var(--bs-secondary-color);text-decoration:none;border-bottom:3px solid transparent}
.tf-top-link:hover{color:var(--bs-primary)}
.tf-top-link.active{color:var(--bs-primary);border-bottom-color:var(--bs-primary)}
/* push the sidebar and main content down to clear the top nav row */
.tf-sidebar{top:calc(var(--bs-topbar-height) + var(--tf-topnav-h))!important}
.tf-main{padding-top:calc(var(--bs-topbar-height) + var(--tf-topnav-h))!important}
.tf-nav .tf-group .cat{padding-top:14px}
/* impersonation banner */
.tf-impersonate-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  background:#b45309;color:#fff;padding:9px 16px;border-radius:8px;margin-bottom:16px;font-size:14px}
.tf-impersonate-bar .btn-light{font-weight:600}
@media(max-width:991px){
  .tf-topnav{top:var(--bs-topbar-height)}
  .tf-sidebar{top:calc(var(--bs-topbar-height) + var(--tf-topnav-h))!important}
}

/* Client Profile tabs + key/value tables */
.tf-cp-tabs{flex-wrap:wrap;border-bottom:1px solid var(--tf-border,#e5e7eb);gap:2px}
.tf-cp-tabs .nav-link{padding:7px 12px;font-size:13px;font-weight:600;color:#64748b;border:1px solid transparent;border-bottom:none;border-radius:7px 7px 0 0}
.tf-cp-tabs .nav-link:hover{color:#1e4fa3;background:rgba(30,79,163,.06)}
.tf-cp-tabs .nav-link.active{color:#17408a;background:#fff;border-color:var(--tf-border,#e5e7eb);border-bottom:2px solid #fff;margin-bottom:-1px}
table.tf-kv td{padding:.3rem .4rem;border:0;vertical-align:top}
table.tf-kv td:first-child{width:42%;white-space:nowrap}

/* ===================== Theme polish (more attractive, dark-safe) ===================== */
:root{
  --tf-shadow:0 1px 2px rgba(16,24,40,.04),0 4px 14px rgba(16,24,40,.06);
  --tf-shadow-lg:0 10px 30px rgba(16,24,40,.12);
  --tf-radius:14px;
}
/* soft page background (light only) */
:root:not([data-bs-theme="dark"]) body{background:#f3f5fb!important}

/* cards: depth + rounded + hover lift */
.tf-card{border-radius:var(--tf-radius);box-shadow:var(--tf-shadow);border-color:rgba(16,24,40,.07);transition:box-shadow .2s ease, transform .2s ease}
.tf-card:hover{box-shadow:var(--tf-shadow-lg)}
.tf-card .hd{background:linear-gradient(180deg,rgba(38,99,201,.045),rgba(38,99,201,0));border-bottom-color:rgba(16,24,40,.07);border-radius:var(--tf-radius) var(--tf-radius) 0 0}
.tf-card .hd h5,.tf-card .hd h6{letter-spacing:.2px}

/* stat tiles */
.tf-stat{border-radius:var(--tf-radius);box-shadow:var(--tf-shadow);border-color:rgba(16,24,40,.07);transition:box-shadow .2s ease, transform .2s ease;overflow:hidden}
.tf-stat:hover{transform:translateY(-2px);box-shadow:var(--tf-shadow-lg)}
.tf-stat .ic{box-shadow:0 6px 16px rgba(38,99,201,.22)}

/* primary buttons get a gradient + glow */
.btn-gold{background:linear-gradient(135deg,#2663c9,#17408a);border:none;color:#fff;box-shadow:0 4px 12px rgba(38,99,201,.22)}
.btn-gold:hover{background:linear-gradient(135deg,#2f6ed6,#1b4a9c);color:#fff;box-shadow:0 7px 18px rgba(38,99,201,.33)}
.btn-navy{background:linear-gradient(135deg,#243150,#0f1b33);border:none;color:#fff;box-shadow:0 4px 12px rgba(15,27,51,.2)}
.btn-navy:hover{filter:brightness(1.08);color:#fff}
.btn,.btn-sm{border-radius:9px}

/* inputs + Tom Select: rounder with focus ring */
.form-control,.form-select,.ts-control{border-radius:9px}
.form-control:focus,.form-select:focus,.ts-wrapper.focus .ts-control{box-shadow:0 0 0 .2rem rgba(38,99,201,.15);border-color:#2663c9}

/* tables: crisp header + row hover (fills light-only) */
.table tbody tr{transition:background .12s ease}
:root:not([data-bs-theme="dark"]) .table thead th{background:#eef2fb;color:#334155;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.04em}
:root:not([data-bs-theme="dark"]) .table tbody tr:hover td{background:rgba(38,99,201,.04)}

/* top chrome elevation */
.tf-topbar{box-shadow:0 1px 0 rgba(16,24,40,.05)}
.tf-topnav{box-shadow:0 3px 12px rgba(16,24,40,.05)}
.tf-top-link.active{border-bottom-width:3px}

/* sidebar active accent */
.tf-nav a.active{box-shadow:inset 3px 0 0 var(--bs-primary)}

/* profile tabs refined */
.tf-cp-tabs .nav-link{border-radius:9px 9px 0 0}

/* badges */
.badge{border-radius:7px;font-weight:600;letter-spacing:.2px}

/* ribbon/hero a touch deeper */
.tf-ribbon{box-shadow:0 10px 26px rgba(38,99,201,.22)}
