/* =============================================================
   Tracer Study ISI Surakarta — Global Stylesheet
   ============================================================= */

:root {
  --primary:       #7b0000;
  --primary-light: #a31515;
  --accent:        #e8c547;
  --accent-light:  #f5d76e;
  --sidebar-w:     260px;
  --sidebar-bg:    #6b0000;
  --sidebar-text:  #f5c8c8;
  --sidebar-hover: rgba(255,255,255,.10);
  --sidebar-active:#a31515;
  --topbar-h:      60px;
  --body-bg:       #f7f0f0;
  --card-radius:   .75rem;
  --shadow-sm:     0 1px 4px rgba(0,0,0,.07);
  --shadow-md:     0 4px 16px rgba(0,0,0,.10);
  --transition:    .2s ease;
}

/* ── Reset / Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--body-bg);
  color: #1e293b;
  font-size: .9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* =============================================================
   PUBLIC PAGES (index / login)
   ============================================================= */
.public-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #4a0000 0%, #7b0000 50%, #a31515 100%);
}

.public-card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
}

.public-logo {
  width: 80px;
  height: 80px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: #fff;
  font-size: 2rem;
  border: 3px solid rgba(255,255,255,.25);
}

/* Hero section (index) */
.hero-section {
  padding: 80px 0 60px;
}
.hero-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,.8);
}
.role-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--card-radius);
  padding: 2rem 1.5rem;
  text-align: center;
  color: #fff;
  transition: var(--transition);
  cursor: pointer;
}
.role-card:hover {
  background: rgba(255,255,255,.16);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.role-card .role-icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  display: block;
}

/* =============================================================
   LOGIN PAGE
   ============================================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(74,0,0,.87) 0%, rgba(123,0,0,.87) 55%, rgba(163,21,21,.87) 100%),
    url('../img/background.webp') center / cover no-repeat;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 60vmin;
  height: 60vmin;
  background: url('../img/logo.webp') center / contain no-repeat;
  opacity: .07;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}
.login-brand .brand-icon {
  width: 72px;
  height: 72px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .75rem;
  color: #fff;
  font-size: 1.75rem;
  border: 3px solid rgba(123,0,0,.15);
  overflow: hidden;
}
.login-brand .brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}
.login-brand h5 {
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  font-size: 1rem;
}
.login-brand small {
  color: #64748b;
  font-size: .82rem;
}

.badge-role {
  display: inline-block;
  padding: .35em .8em;
  border-radius: 2rem;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 1.25rem;
}
.badge-superadmin { background: #fef3c7; color: #92400e; }
.badge-prodi      { background: #dbeafe; color: #1e40af; }
.badge-alumni     { background: #d1fae5; color: #065f46; }

/* =============================================================
   SIDEBAR LAYOUT (dashboard)
   ============================================================= */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--topbar-h); left: 0;
  height: calc(100vh - var(--topbar-h));
  z-index: 1040;
  transition: transform var(--transition);
  overflow-y: auto;
}

/* No sidebar-brand; brand lives in topbar */

.sidebar-user {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sidebar-user .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--sidebar-active);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff; flex-shrink: 0;
}
.sidebar-user .user-info {
  overflow: hidden;
}
.sidebar-user .user-name {
  font-size: .85rem;
  font-weight: 600;
  color: #e2eaf4;
  word-break: break-word;
  line-height: 1.3;
}
.sidebar-user .user-role {
  font-size: .72rem;
  color: var(--sidebar-text);
  text-transform: capitalize;
}

.sidebar-nav {
  flex: 1;
  padding: .75rem 0;
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(200,216,234,.45);
  padding: .75rem 1.25rem .3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.25rem;
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 400;
  border-radius: 0;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar-link.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-logout-link {
  color: #ffb3b3;
  margin-top: .5rem;
}
.sidebar-logout-link:hover {
  background: rgba(220,38,38,.2);
  color: #ffd0d0;
}

.topbar-logout-btn {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1060;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 1.25rem;
  color: rgba(255,255,255,.85);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 1px solid rgba(255,255,255,.15);
  transition: var(--transition);
  white-space: nowrap;
}
.topbar-logout-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--topbar-h);
}

/* Topbar — fixed full-width across top */
.topbar {
  height: var(--topbar-h);
  background: var(--primary);
  border-bottom: 1px solid #6b0000;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  padding-right: 110px;
  gap: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.topbar .sidebar-toggle {
  display: none;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: .4rem;
  font-size: 1.25rem;
  color: #fff;
  cursor: pointer;
  padding: .2rem .45rem;
  line-height: 1;
}
.topbar .sidebar-toggle:hover {
  background: rgba(255,255,255,.22);
}
/* Topbar brand — always visible on the left of the topbar */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-right: 1.25rem;
  padding-right: 1.25rem;
  border-right: 1px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}
.topbar-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.topbar-brand .brand-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.topbar-brand .brand-label span {
  display: inline;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.topbar-title {
  font-size: .95rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
}

/* Page content */
.page-content {
  padding: 1.5rem;
  flex: 1;
}

.page-header {
  margin-bottom: 1.5rem;
}
.page-header h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 .25rem;
}
.page-header p {
  color: #64748b;
  margin: 0;
  font-size: .875rem;
}

/* Breadcrumb */
.breadcrumb-wrap {
  margin-bottom: 1rem;
}
.breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
  font-size: .82rem;
}
.breadcrumb-item + .breadcrumb-item::before { color: #94a3b8; }
.breadcrumb-item.active { color: #64748b; }

/* =============================================================
   CARDS & STATS
   ============================================================= */
.stat-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.bg-blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.bg-green  { background: #d1fae5; color: #059669; }
.stat-icon.bg-orange { background: #ffedd5; color: #c2410c; }
.stat-icon.bg-purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.bg-teal   { background: #ccfbf1; color: #0f766e; }

.stat-info .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
}
.stat-info .stat-label {
  font-size: .8rem;
  color: #64748b;
  margin-top: .2rem;
}

/* Content card */
.content-card {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.content-card .card-header-custom {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.content-card .card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}
.content-card .card-body-custom {
  padding: 1.25rem 1.5rem;
}

/* =============================================================
   TABLE
   ============================================================= */
.table-responsive { border-radius: var(--card-radius); }

.table-custom {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table-custom thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.table-custom tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.table-custom tbody tr:last-child td { border-bottom: none; }
.table-custom tbody tr:hover td { background: #f8fafc; }

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
  font-size: .875rem;
  font-weight: 500;
  border-radius: .5rem;
  padding: .45rem .9rem;
  transition: var(--transition);
}
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-primary {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(163,21,21,.25);
}
.btn-action { border: none; background: none; padding: .3rem .5rem; border-radius: .4rem; }
.btn-edit   { color: #2563ab; } .btn-edit:hover   { background: #dbeafe; color: #1d4ed8; }
.btn-delete { color: #dc2626; } .btn-delete:hover { background: #fee2e2; color: #b91c1c; }
.btn-view   { color: #059669; } .btn-view:hover   { background: #d1fae5; color: #047857; }

/* =============================================================
   FORMS
   ============================================================= */
.form-label { font-size: .875rem; font-weight: 500; color: #374151; margin-bottom: .3rem; }
.form-control, .form-select {
  font-size: .875rem;
  border-color: #d1d5db;
  border-radius: .5rem;
  padding: .5rem .85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,168,.12);
}
.input-group-text { background: #f8fafc; border-color: #d1d5db; font-size: .875rem; }

/* Badge */
.badge { font-size: .72rem; font-weight: 600; padding: .35em .65em; border-radius: .4rem; }

/* Alert */
.alert { border-radius: .6rem; font-size: .875rem; }

/* =============================================================
   MODAL
   ============================================================= */
.modal-header { background: var(--primary); color: #fff; border-radius: .75rem .75rem 0 0; border-bottom: 2px solid var(--primary-light); }
.modal-header .btn-close { filter: brightness(0) invert(1); }
.modal-content { border-radius: .75rem; border: none; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-title { font-size: .95rem; font-weight: 600; }

/* =============================================================
   PAGINATION
   ============================================================= */
.pagination { gap: .2rem; }
.page-link {
  border-radius: .45rem !important;
  font-size: .82rem;
  padding: .35rem .65rem;
  color: var(--primary-light);
  border-color: #e2e8f0;
}
.page-link:hover { background: #dbeafe; border-color: #bfdbfe; color: var(--primary); }
.page-item.active .page-link { background: var(--primary-light); border-color: var(--primary-light); }

/* =============================================================
   SEARCH BAR
   ============================================================= */
.search-box { max-width: 280px; }
.search-box-wrap { position: relative; }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 991.98px) {
  .sidebar {
    top: 0;
    height: 100vh;
    transform: translateX(calc(-1 * var(--sidebar-w)));
    padding-top: var(--topbar-h);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .topbar .sidebar-toggle {
    display: block;
  }
  .topbar {
    padding-right: 1rem;
  }
  .topbar-brand .brand-label {
    font-size: .85rem;
  }
  .topbar-brand img {
    width: 36px;
    height: 36px;
  }
  .topbar-logout-btn {
    display: none;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 575.98px) {
  .page-content { padding: 1rem; }
  .content-card .card-header-custom { flex-direction: column; align-items: flex-start; }
  .stat-card { padding: 1rem; }
  .stat-info .stat-value { font-size: 1.3rem; }
}

/* =============================================================
   ALUMNI PORTAL — Topbar & Navigation
   ============================================================= */
.alumni-topbar {
  background: var(--primary);
  color: #fff;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.alumni-topbar .brand { font-weight: 700; font-size: .95rem; }
.alumni-topbar .brand small { font-weight: 400; font-size: .78rem; opacity: .8; }
.alumni-nav-bar {
  background: #fff;
  border-bottom: 2px solid #f1f5f9;
  padding: 0 1.5rem;
  display: flex;
}
.alumni-nav-link {
  display: inline-flex;
  align-items: center;
  padding: .7rem 1.1rem;
  font-size: .875rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
}
.alumni-nav-link:hover { color: var(--primary); }
.alumni-nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.alumni-nav-link.nav-locked { cursor: not-allowed; opacity: .55; }
.alumni-nav-link.nav-locked:hover { color: #6b7280; }
.nav-step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: #f59e0b; color: #fff; font-size: .65rem; font-weight: 700;
  margin-left: .3rem; flex-shrink: 0;
}

/* =============================================================
   UTILITIES
   ============================================================= */
.text-primary-dark { color: var(--primary) !important; }
.bg-primary-dark   { background: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.cursor-pointer { cursor: pointer; }
.no-data {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}
.no-data i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

/* =============================================================
   KUESIONER PENGGUNA (public employer questionnaire page)
   ============================================================= */
.pg-header {
    background: var(--primary);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.pg-header img { height: 42px; }
.pg-header .brand { font-weight: 700; font-size: 1.1rem; }
.pg-header .brand span { font-weight: 300; }
.pg-content { max-width: 800px; margin: 2rem auto; padding: 0 1rem 4rem; }
.section-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.q-label {
    font-weight: 600;
    font-size: .95rem;
    color: #1e293b;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}
.q-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.q-wajib { color: #ef4444; }
.scale-table { width: 100%; border-collapse: collapse; }
.scale-table th {
    font-size: .75rem; color: #64748b; font-weight: 600;
    padding: .4rem .3rem; text-align: center; border-bottom: 2px solid #e2e8f0;
}
.scale-table th.label-col { text-align: left; min-width: 180px; }
.scale-table td { padding: .55rem .25rem; text-align: center; border-bottom: 1px solid #f1f5f9; }
.scale-table td.label-cell {
    font-size: .9rem; color: #374151; text-align: left;
    font-weight: 500; padding: .55rem .75rem;
}
.scale-table input[type=radio] {
    accent-color: var(--primary);
    width: 18px; height: 18px; cursor: pointer;
}
.scale-table tr:hover td { background: #fafafa; }
.sticky-footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid #e2e8f0;
    padding: .75rem 1.5rem;
    display: flex; justify-content: flex-end; gap: .75rem; align-items: center;
    z-index: 100; box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.info-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.info-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; }
.info-item { display: flex; align-items: center; gap: .4rem; font-size: .875rem; color: #475569; }
.info-item strong { color: #1e293b; }
.success-screen { text-align: center; padding: 3rem 1rem; }
.success-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: #dcfce7; color: #16a34a;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; margin: 0 auto 1.5rem;
}
.alert-custom { padding: .75rem 1rem; border-radius: 8px; font-size: .875rem; margin-bottom: 1rem; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.filled-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    background: #dcfce7; color: #15803d;
    padding: .25rem .7rem; border-radius: 20px; font-size: .8rem; font-weight: 600;
}
@media (max-width: 576px) {
    .scale-table th, .scale-table td { padding: .35rem .1rem; font-size: .78rem; }
    .scale-table th.label-col, .scale-table td.label-cell { font-size: .8rem; padding: .35rem .4rem; }
}
