:root{
  --brand:#009fb5;
  --brand-dark:#007f91;
  --brand-soft:#e6f7fa;

  --text:#1f2937;
  --muted:#6b7280;
  --line:#d9e2e7;
  --bg:#f4f7f8;
  --panel:#ffffff;

  --ok-bg:#ecfdf3;
  --ok-border:#abefc6;
  --ok-text:#067647;

  --error-bg:#fef3f2;
  --error-border:#fecdca;
  --error-text:#b42318;

  --warn-bg:#fffaeb;
  --warn-border:#fedf89;
  --warn-text:#b54708;

  --danger:#b42318;
  --danger-dark:#912018;

  --shadow:0 10px 30px rgba(0,0,0,0.06);
  --radius:14px;
  --radius-small:10px;
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  padding:0;
  font-family:Arial, Helvetica, sans-serif;
  background:var(--bg);
  color:var(--text);
}

body.admin-body{
  min-height:100vh;
  display:flex;
}

/* ------------------------------
   SIDEBAR
------------------------------ */
.sidebar{
  width:280px;
  min-width:280px;
  background:var(--panel);
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  min-height:100vh;
}

.sidebar-top{
  padding:20px 16px;
  border-bottom:1px solid var(--line);
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:inherit;
}

.sidebar-brand-logo{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:inherit;
}

.brand-logo{
  width:52px;
  height:52px;
  object-fit:contain;
  display:block;
  flex:0 0 auto;
}

.logo-dot{
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--brand);
  flex:0 0 auto;
}

.brand-title{
  font-size:18px;
  font-weight:700;
  line-height:1.1;
  color:var(--brand);
}

.brand-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:3px;
}

.nav{
  padding:12px 10px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.nav-item{
  display:block;
  padding:11px 14px;
  border-radius:12px;
  color:var(--text);
  text-decoration:none;
  transition:background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-item:hover{
  background:var(--brand-soft);
  color:var(--brand-dark);
  transform:translateX(2px);
}

.nav-item.active{
  background:var(--brand);
  color:#ffffff;
  font-weight:700;
}

.sidebar-bottom{
  margin-top:auto;
  padding:16px;
  border-top:1px solid var(--line);
}

.user-box{
  display:flex;
  align-items:center;
  gap:12px;
}

.user-avatar{
  width:42px;
  height:42px;
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  box-shadow:var(--shadow);
}

.user-meta{
  min-width:0;
}

.user-name{
  font-size:14px;
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.user-link{
  font-size:13px;
  color:var(--brand);
  text-decoration:none;
}

.user-link:hover{
  color:var(--brand-dark);
  text-decoration:underline;
}

/* ------------------------------
   MAIN CONTENT
------------------------------ */
.content{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  min-height:100vh;
}

.topbar{
  background:var(--panel);
  border-bottom:1px solid var(--line);
  padding:16px 22px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  position:sticky;
  top:0;
  z-index:10;
}

.topbar-left,
.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.crumb{
  font-size:14px;
  color:var(--muted);
}

.crumb-sep{
  font-size:14px;
  color:#9aa4b2;
}

.content-inner{
  padding:24px;
}

.page-title{
  margin-bottom:18px;
}

.page-title h1{
  margin:0 0 6px 0;
  font-size:28px;
  line-height:1.1;
}

.muted{
  color:var(--muted);
}

.small{
  font-size:12px;
}

/* ------------------------------
   PANELS / CARDS
------------------------------ */
.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  margin-bottom:20px;
  overflow:hidden;
}

.panel-head{
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  font-weight:700;
  background:#fcfdfd;
}

.panel-head-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.panel-head-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.panel-body{
  padding:18px;
}

.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:16px;
  margin-bottom:20px;
}

.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px;
}

.card-kpi{
  font-size:34px;
  line-height:1;
  font-weight:700;
  color:var(--brand);
  margin-bottom:8px;
}

.card-label{
  color:var(--muted);
  font-size:14px;
}

/* ------------------------------
   ALERTS
------------------------------ */
.alert{
  padding:14px 16px;
  border-radius:12px;
  border:1px solid transparent;
  margin-bottom:16px;
}

.alert-ok{
  background:var(--ok-bg);
  border-color:var(--ok-border);
  color:var(--ok-text);
}

.alert-error{
  background:var(--error-bg);
  border-color:var(--error-border);
  color:var(--error-text);
}

.alert-warn{
  background:var(--warn-bg);
  border-color:var(--warn-border);
  color:var(--warn-text);
}

/* ------------------------------
   BUTTONS
------------------------------ */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
  font-size:14px;
  line-height:1;
  transition:all 0.2s ease;
}

.btn:hover{
  border-color:var(--brand);
  color:var(--brand);
}

.btn:focus,
input:focus,
select:focus,
textarea:focus{
  outline:none;
  box-shadow:0 0 0 4px rgba(0,159,181,0.15);
}

.btn-primary{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

.btn-primary:hover{
  background:var(--brand-dark);
  border-color:var(--brand-dark);
  color:#fff;
}

.btn-danger{
  background:#fff;
  border-color:#f3c1bc;
  color:var(--danger);
}

.btn-danger:hover{
  background:var(--danger);
  border-color:var(--danger);
  color:#fff;
}

.btn-small{
  padding:8px 12px;
  font-size:13px;
}

/* ------------------------------
   FORMS
------------------------------ */
.form{
  display:grid;
  gap:16px;
}

.form label{
  display:grid;
  gap:8px;
}

.form label > span{
  font-size:14px;
  font-weight:700;
  color:var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea,
.input{
  width:100%;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  font-size:14px;
}

textarea{
  min-height:120px;
  resize:vertical;
}

.check{
  display:flex !important;
  align-items:flex-start;
  gap:10px;
}

.check input[type="checkbox"]{
  margin-top:2px;
}

.actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* ------------------------------
   TABLES
------------------------------ */
.table-wrap{
  width:100%;
  overflow-x:auto;
}

.table{
  width:100%;
  border-collapse:collapse;
  min-width:760px;
}

.table thead th{
  text-align:left;
  background:#f9fbfb;
  color:#4b5563;
  font-size:13px;
  font-weight:700;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}

.table tbody td{
  padding:12px 14px;
  border-bottom:1px solid #edf2f4;
  vertical-align:top;
  font-size:14px;
}

.table tbody tr:hover{
  background:#fbfefe;
}

.nowrap{
  white-space:nowrap;
}

.inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.inline form{
  display:inline;
}

/* ------------------------------
   MISC
------------------------------ */
.pill{
  display:inline-block;
  padding:5px 10px;
  border-radius:999px;
  background:var(--brand-soft);
  color:var(--brand-dark);
  font-size:12px;
  font-weight:700;
}

code{
  background:#f3f7f8;
  border:1px solid #e4ecef;
  border-radius:8px;
  padding:2px 6px;
  font-family:"Courier New", monospace;
  font-size:13px;
}

a{
  color:var(--brand);
}

a:hover{
  color:var(--brand-dark);
}

/* ------------------------------
   RESPONSIVE
------------------------------ */
@media (max-width: 1100px){
  .sidebar{
    width:240px;
    min-width:240px;
  }

  .content-inner{
    padding:18px;
  }
}

@media (max-width: 860px){
  body.admin-body{
    flex-direction:column;
  }

  .sidebar{
    width:100%;
    min-width:0;
    min-height:auto;
    border-right:none;
    border-bottom:1px solid var(--line);
  }

  .nav{
    flex-direction:row;
    flex-wrap:wrap;
  }

  .nav-item{
    transform:none !important;
  }

  .content{
    min-height:auto;
  }

  .topbar{
    position:static;
    padding:14px 16px;
  }

  .content-inner{
    padding:16px;
  }
}

@media (max-width: 640px){
  .page-title h1{
    font-size:24px;
  }

  .panel-head-row,
  .topbar,
  .topbar-left,
  .topbar-right,
  .actions{
    align-items:flex-start;
  }

  .btn,
  .btn-small{
    width:100%;
    justify-content:center;
  }

  .inline{
    width:100%;
    flex-wrap:wrap;
  }

  .inline .input{
    min-width:100%;
  }

  .table{
    min-width:640px;
  }
}
/* ------------------------------
   LOGIN
------------------------------ */
body.login-body{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px;
  background:
    radial-gradient(circle at top left, rgba(0,159,181,0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(0,127,145,0.18), transparent 24%),
    linear-gradient(135deg, #f4f7f8 0%, #eef6f8 100%);
}

.login-shell{
  width:100%;
  max-width:1100px;
}

.login-panel{
  display:grid;
  grid-template-columns: 1.1fr 460px;
  gap:32px;
  align-items:stretch;
}

.login-hero{
  background:linear-gradient(135deg, var(--brand), var(--brand-dark));
  color:#fff;
  border-radius:24px;
  padding:48px;
  box-shadow:0 24px 60px rgba(0,0,0,0.12);
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:560px;
}

.login-badge{
  display:inline-flex;
  align-self:flex-start;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(255,255,255,0.16);
  color:#fff;
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:20px;
}

.login-hero h1{
  margin:0 0 16px 0;
  font-size:44px;
  line-height:1.05;
  font-weight:800;
}

.login-hero p{
  margin:0;
  font-size:17px;
  line-height:1.7;
  color:rgba(255,255,255,0.92);
  max-width:520px;
}

.login-card{
  background:rgba(255,255,255,0.96);
  border:1px solid rgba(217,226,231,0.9);
  border-radius:24px;
  padding:34px;
  box-shadow:0 24px 60px rgba(0,0,0,0.10);
  backdrop-filter:blur(8px);
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.login-brand{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:26px;
}

.login-logo{
  width:56px;
  height:56px;
  object-fit:contain;
  display:block;
  flex:0 0 auto;
}

.login-form{
  gap:18px;
}

.login-form label{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.login-form label span{
  font-size:13px;
  font-weight:700;
  color:var(--muted);
}

.login-form input{
  width:100%;
  height:48px;
  padding:0 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  color:var(--text);
  font-size:15px;
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.login-form input:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(0,159,181,0.12);
}

.login-submit{
  width:100%;
  justify-content:center;
  height:48px;
  margin-top:4px;
  font-size:15px;
  font-weight:700;
}

.login-hint{
  margin-top:8px;
  padding:14px 16px;
  border-radius:12px;
  background:var(--brand-soft);
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
}

.login-hint code{
  background:rgba(255,255,255,0.7);
  border:1px solid rgba(0,0,0,0.06);
  padding:2px 6px;
  border-radius:6px;
}

@media (max-width: 980px){
  .login-panel{
    grid-template-columns:1fr;
  }

  .login-hero{
    min-height:auto;
    padding:34px;
  }

  .login-hero h1{
    font-size:34px;
  }
}

@media (max-width: 640px){
  body.login-body{
    padding:16px;
  }

  .login-card,
  .login-hero{
    padding:22px;
    border-radius:18px;
  }

  .login-hero h1{
    font-size:28px;
  }
}
/* ------------------------------
   REPORTS
------------------------------ */
.report-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:18px;
}

.report-card{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:22px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  text-decoration:none;
  color:inherit;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.report-card:hover{
  transform:translateY(-3px);
  border-color:var(--brand);
  box-shadow:0 16px 36px rgba(0,0,0,0.08);
}

.report-card-kicker{
  display:inline-flex;
  align-self:flex-start;
  padding:6px 10px;
  border-radius:999px;
  background:var(--brand-soft);
  color:var(--brand-dark);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.report-card h3{
  margin:0;
  font-size:20px;
}

.report-card p{
  margin:0;
  color:var(--muted);
  line-height:1.6;
}

.stack-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:320px;
}

.stack-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
/* ------------------------------
   CONFIG / REPORT DETAILS
------------------------------ */
.grid-2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.form-actions{
  display:flex;
  gap:12px;
  margin-top:18px;
  flex-wrap:wrap;
}

.info-strip{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:16px;
  margin:18px 0 22px 0;
}

.stat-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:16px;
}

.stat-label{
  color:var(--muted);
  font-size:13px;
  margin-bottom:8px;
}

.stat-value{
  font-size:28px;
  font-weight:700;
  color:var(--brand-dark);
}

.detail-head{
  margin-bottom:14px;
}

.pill-ok{
  background:var(--ok-bg);
  color:var(--ok-text);
  border:1px solid var(--ok-border);
}

.pill-warn{
  background:var(--warn-bg);
  color:var(--warn-text);
  border:1px solid var(--warn-border);
}

@media (max-width: 700px){
  .grid-2{
    grid-template-columns:1fr;
  }
}
/* ------------------------------
   CONNECTION REPORT
------------------------------ */
.search-report-form{
  gap:14px;
}

.report-search-row{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.report-search-input{
  flex:1 1 340px;
  min-width:260px;
  height:46px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:0 14px;
  background:#fff;
  outline:none;
}

.report-search-input:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(0,159,181,0.12);
}

.student-card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:16px;
}

.student-report-card{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:18px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  text-decoration:none;
  color:inherit;
  box-shadow:var(--shadow);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.student-report-card:hover{
  transform:translateY(-2px);
  border-color:var(--brand);
  box-shadow:0 16px 36px rgba(0,0,0,0.08);
}

.student-report-top{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
}

.student-report-top h4{
  margin:0 0 6px 0;
  font-size:18px;
}

.student-report-stats{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.mini-stat{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  background:var(--panel);
}

.mini-stat-label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

.student-report-footer{
  display:flex;
  justify-content:flex-end;
}

.stat-value-small{
  font-size:16px;
  line-height:1.4;
}
.traffic-light{
  width:34px;
  height:34px;
  border-radius:50%;
  display:inline-block;
  margin-top:3px;
  box-shadow:0 0 0 3px rgba(0,0,0,0.04);
  flex:0 0 auto;
}

.traffic-ok{
  background:#16a34a;
}

.traffic-unknown{
  background:#9ca3af;
}

.traffic-user_not_found,
.traffic-course_not_found,
.traffic-not_enrolled,
.traffic-missing_mapping,
.traffic-error{
  background:#dc2626;
}
.traffic-ok{
  background:#16a34a;
}

.traffic-unknown{
  background:#9ca3af;
}

.traffic-user_not_found,
.traffic-course_not_found,
.traffic-not_enrolled,
.traffic-missing_mapping,
.traffic-error{
  background:#dc2626;
}
.traffic-wrap{
	display:flex;
	gap:10px;
}
.traffic-green{
  background:#16a34a;
}

.traffic-red{
  background:#dc2626;
}
