
/* ==========================================================================
   AJTECH UI POLISH — cross-page consistency layer
   Loaded after design-system.css. Keeps the existing PHP/JS behaviour intact.
   ========================================================================== */

:root{
  --brand:#1769aa;
  --brand-600:#155e9a;
  --brand-soft:#eaf4fb;
  --brand-ring:rgba(23,105,170,.14);
  --ink:#0f2f52;
  --text:#1e293b;
  --muted:#64748b;
  --paper:#f6f8fb;
  --surface:#fff;
  --line:#dfe6ee;
  --line-strong:#cbd5e1;
  --radius:12px;
  --radius-lg:16px;
  --sidebar-width:256px;
}

html{background:var(--paper);}
body,
button,input,select,textarea{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important;}
body{background:var(--paper) !important;color:var(--text);}

h1,h2,h3,h4,h5,h6{color:var(--ink);}

/* Make the design system's indigo aliases agree with the portal blue. */
.btn-primary{
  background:var(--brand) !important;
  box-shadow:0 1px 2px rgba(23,105,170,.22) !important;
}
.btn-primary:hover{background:var(--brand-600) !important;box-shadow:0 8px 24px rgba(23,105,170,.18) !important;}
.btn-secondary:hover{border-color:var(--brand) !important;color:var(--brand) !important;background:var(--brand-soft) !important;}
.ds-input:focus,.ds-select:focus,.ds-textarea:focus,
input:focus,select:focus,textarea:focus{
  border-color:var(--brand) !important;
  box-shadow:0 0 0 3px var(--brand-ring) !important;
}
.ds-pill-indigo{background:var(--brand-soft) !important;color:var(--brand) !important;border-color:#cfe3f4 !important;}
.ds-card,.ds-panel,.ds-stat,.ds-table-wrap,.ds-filter-panel,.ds-empty{
  border-color:var(--line) !important;
  border-radius:var(--radius-lg) !important;
  box-shadow:0 1px 3px rgba(15,47,82,.04) !important;
}
.ds-card:hover,.ds-stat:hover{box-shadow:0 8px 24px rgba(15,47,82,.07) !important;}
.ds-stat:hover{border-color:#b9d7ec !important;}
.ds-stat-icon{background:var(--brand-soft) !important;}
.ds-stat-icon i{color:var(--brand) !important;}

.btn{border-radius:10px !important;}
.btn-lg{border-radius:12px !important;}
.btn-sm{border-radius:9px !important;}

/* Consistent admin/staff rail. */
#sidebar{
  width:var(--sidebar-width) !important;
  background:#fff !important;
  border-right:1px solid var(--line) !important;
  box-shadow:4px 0 22px rgba(15,23,42,.045) !important;
}
#sidebar .nav-item{
  min-height:42px !important;
  border-radius:9px !important;
  color:#475569 !important;
}
#sidebar .nav-item.active,
#sidebar .nav-item[aria-current="page"]{
  color:var(--brand) !important;
  background:var(--brand-soft) !important;
  box-shadow:inset 3px 0 0 var(--brand) !important;
}
#sidebar .nav-icon,
#sidebar .nav-icon.green{
  background:#f3f6f9 !important;
  color:#64748b !important;
}
#sidebar .nav-item.active .nav-icon,
#sidebar .nav-item[aria-current="page"] .nav-icon,
#sidebar .nav-item:hover .nav-icon{
  background:#dbeef9 !important;
  color:var(--brand) !important;
}
#sidebar .nav-item:hover{background:#f3f8fc !important;color:var(--brand) !important;}
#sidebar .nav-group-label{color:#94a3b8 !important;}
#sidebar .user-card{background:#f7fafc !important;border-color:var(--line) !important;}
#sidebar .logout-btn{border-radius:9px !important;}

.ds-main,
.dash-main{
  margin-left:var(--sidebar-width) !important;
  max-width:none;
}
.ds-main{padding:28px 30px 72px !important;}
.dash-main{padding:28px 30px 72px !important;}

@media(max-width:767px){
  .ds-main,.dash-main{margin-left:0 !important;padding:18px 14px 64px !important;}
}

/* Portal rail was 270px while the main system is 256px. */
#portal-sidebar{
  width:var(--sidebar-width) !important;
  border-right:1px solid var(--line) !important;
  box-shadow:4px 0 22px rgba(15,23,42,.045) !important;
}
#portal-sidebar .portal-sidebar-header{min-height:70px !important;}
#portal-sidebar .portal-nav-link{min-height:43px !important;border-radius:9px !important;}
#portal-sidebar .portal-nav-link.active{color:var(--brand) !important;background:var(--brand-soft) !important;box-shadow:inset 3px 0 0 var(--brand) !important;}
#portal-sidebar .portal-nav-link:hover{color:var(--brand) !important;background:#f3f8fc !important;}
#portal-sidebar .portal-avatar{background:var(--brand-soft) !important;border-color:#cfe3f4 !important;color:var(--brand) !important;}

@media(max-width:767px){
  #portal-sidebar{width:min(282px,86vw) !important;}
}

/* Never let dense academic tables break the page on phones. */
.ds-table-wrap,
table:not(.no-responsive){overflow-x:auto;max-width:100%;}
.ds-table{min-width:680px;}
@media(max-width:767px){
  .ds-table{font-size:.78rem;}
  .ds-table thead th,.ds-table tbody td{padding:.62rem .72rem;}
}

/* Form controls share one visual language. */
input,select,textarea{
  border-color:var(--line) !important;
  border-radius:10px !important;
}
label{color:#475569;}
button{font-family:inherit;}

/* Page headings that appear in older pages. */
.page-title,
.section-title{color:var(--ink) !important;letter-spacing:-.02em;}

/* Kill accidental legacy gradients/glass effects while retaining intentional
   dashboard hero areas that explicitly use the dark shell. */
.glass-effect,.glass{
  backdrop-filter:none !important;
}

/* Better focus and motion accessibility. */
a,button,input,select,textarea{outline-offset:3px;}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto !important;animation-duration:.01ms !important;transition-duration:.01ms !important;}
}

/* Empty portal logo blocks from the old sidebar are now useful brand marks. */
#portal-sidebar .portal-sidebar-header > div:first-child > div:first-child{
  background:var(--brand-soft) !important;
  border:1px solid #cfe3f4 !important;
  border-radius:9px !important;
  position:relative;
}
#portal-sidebar .portal-sidebar-header > div:first-child > div:first-child::after{
  content:"AJ";
  color:var(--brand);
  font-size:11px;
  font-weight:800;
  letter-spacing:-.03em;
}

/* Landing-page primitives. */
.lp-shell{background:var(--paper);}
.lp-section{max-width:1180px;margin:0 auto;padding:84px 24px;}
.lp-eyebrow{font-size:.68rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--brand);}
.lp-hero{
  position:relative;overflow:hidden;
  background:
    radial-gradient(ellipse 60% 55% at 78% 10%,rgba(23,105,170,.15),transparent 65%),
    radial-gradient(ellipse 45% 40% at 12% 85%,rgba(13,148,136,.08),transparent 65%),
    #f8fbfe;
}
.lp-hero::after{
  content:"";position:absolute;width:520px;height:520px;border:1px solid rgba(23,105,170,.12);
  border-radius:50%;right:-210px;top:-250px;pointer-events:none;
}
.lp-hero-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr);gap:72px;align-items:center;}
.lp-display{font-size:clamp(2.7rem,6vw,5.6rem);line-height:.96;letter-spacing:-.065em;font-weight:900;color:var(--ink);}
.lp-display em{font-style:normal;color:var(--brand);}
.lp-copy{font-size:1.06rem;line-height:1.75;color:#52657a;max-width:620px;}
.lp-workbench{background:#0d1b2f;border:1px solid #223a55;border-radius:20px;padding:14px;box-shadow:0 28px 70px rgba(15,47,82,.2);transform:rotate(1deg);}
.lp-window{background:#f8fafc;border-radius:13px;overflow:hidden;}
.lp-window-top{height:42px;background:#fff;border-bottom:1px solid #e2e8f0;display:flex;align-items:center;gap:7px;padding:0 13px;}
.lp-dot{width:8px;height:8px;border-radius:50%;background:#cbd5e1;}
.lp-window-body{display:grid;grid-template-columns:105px 1fr;min-height:300px;}
.lp-mini-rail{background:#0f2f52;padding:12px 9px;}
.lp-mini-line{height:7px;border-radius:4px;background:rgba(255,255,255,.16);margin:9px 5px;}
.lp-mini-line.active{background:#6eb6df;width:70%;}
.lp-mini-content{padding:16px;}
.lp-mini-title{height:13px;width:48%;border-radius:5px;background:#0f2f52;margin-bottom:15px;}
.lp-mini-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;}
.lp-mini-card{height:70px;border:1px solid #dce5ee;border-radius:9px;background:#fff;padding:9px;}
.lp-mini-card b{display:block;width:35%;height:7px;background:#1769aa;border-radius:4px;margin-bottom:10px;}
.lp-mini-card span{display:block;width:70%;height:6px;background:#e2e8f0;border-radius:4px;}
.lp-mini-table{margin-top:12px;background:#fff;border:1px solid #dce5ee;border-radius:9px;padding:9px;}
.lp-mini-row{height:8px;border-radius:4px;background:#e8edf2;margin:7px 0;}
.lp-mini-row:nth-child(2){width:82%}.lp-mini-row:nth-child(3){width:68%}.lp-mini-row:nth-child(4){width:90%}
.lp-role-strip{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid #dce5ee;background:#fff;}
.lp-role{padding:13px 8px;text-align:center;border-right:1px solid #e8edf2;font-size:.68rem;font-weight:700;color:#52657a;}
.lp-role:last-child{border-right:0;}
.lp-role strong{display:block;color:var(--brand);font-size:.72rem;margin-bottom:3px;}
.lp-module-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;}
.lp-module{padding:22px;background:#fff;border:1px solid var(--line);border-radius:14px;transition:.2s ease;}
.lp-module:hover{transform:translateY(-3px);border-color:#b9d7ec;box-shadow:0 12px 30px rgba(15,47,82,.07);}
.lp-module-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:10px;background:var(--brand-soft);color:var(--brand);margin-bottom:14px;}
.lp-flow{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:#dce5ee;border:1px solid #dce5ee;border-radius:14px;overflow:hidden;}
.lp-flow-step{background:#fff;padding:24px 20px;position:relative;}
.lp-flow-num{font-size:.65rem;font-weight:900;letter-spacing:.12em;color:#94a3b8;}
.lp-flow h3{font-size:1rem;margin:.45rem 0;color:var(--ink);}
.lp-flow p{font-size:.83rem;color:#64748b;line-height:1.6;margin:0;}
.lp-cta{background:#0f2f52;color:#fff;border-radius:18px;padding:54px 28px;text-align:center;position:relative;overflow:hidden;}
.lp-cta::before{content:"";position:absolute;width:300px;height:300px;border:1px solid rgba(255,255,255,.1);border-radius:50%;left:-150px;top:-160px;}
@media(max-width:900px){
  .lp-hero-grid{grid-template-columns:1fr;gap:42px;}
  .lp-workbench{transform:none;}
  .lp-module-grid{grid-template-columns:repeat(2,1fr);}
  .lp-flow{grid-template-columns:repeat(2,1fr);}
}
@media(max-width:640px){
  .lp-section{padding:60px 16px;}
  .lp-display{font-size:clamp(2.55rem,13vw,4rem);}
  .lp-copy{font-size:.98rem;}
  .lp-module-grid,.lp-flow{grid-template-columns:1fr;}
  .lp-role-strip{grid-template-columns:repeat(2,1fr);}
  .lp-role:nth-child(2){border-right:0;}
  .lp-window-body{grid-template-columns:72px 1fr;}
}


/* ===== Full-app consistency pass ===== */
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}
button.bg-indigo-600, .btn-primary, a.bg-indigo-600, .ds-btn-primary {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
}
button.bg-indigo-600:hover, .btn-primary:hover { background: #4338ca !important; }
.ds-card, .bg-white.rounded-xl, .bg-white.rounded-2xl {
  border-radius: 14px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.04) !important;
}
.score-wrap, .staff-wrap, .bs-table-scroll, .tt-view-wrap, #ttGridWrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid rgba(79,70,229,.35) !important;
  outline-offset: 1px;
}
