:root {
  --app-bg: #f4f7fb;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --brand: #0f766e;
  --brand-soft: #e6f7f5;
  --brand-soft-2: #ecfdf5;
  --danger: #b91c1c;
  --warn: #b45309;
  --neutral: #475569;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
}

body {
  background: radial-gradient(circle at 15% 0%, #f8fbff 0%, var(--app-bg) 45%, #edf2f7 100%);
  color: var(--text-main);
  font-weight: 400;
}

/* FreeDash sets .page-wrapper display:none by default and relies on JS.
   Keep content visible even if vendor JS fails on some clients. */
.page-wrapper {
  display: block !important;
}

.page-wrapper > .container-fluid {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  max-width: none !important;
  width: 100%;
}

.card {
  background: var(--card-bg);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.card .card-title,
h4,
h5 {
  color: var(--text-main);
  letter-spacing: 0.1px;
  font-weight: 600;
}

.text-muted,
.form-text {
  color: var(--text-muted) !important;
}

.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  min-height: 42px;
  padding: 0.52rem 0.95rem;
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  vertical-align: middle;
}

.btn-sm {
  min-height: 36px;
  padding: 0.38rem 0.72rem;
  border-radius: 10px;
  font-size: 0.9rem;
  gap: 0.32rem;
}

.alert {
  border-radius: var(--radius-md);
}

.table > :not(caption) > * > * {
  padding: 0.75rem 0.75rem;
}

.table thead th {
  color: #374151;
  font-weight: 600;
}

/* Brighten plain table text globally across all pages, without changing badges/buttons */
.page-wrapper .table tbody td {
  color: #475569;
}

.page-wrapper .table tbody td a:not(.btn) {
  color: #475569;
}

.page-wrapper .table tbody td a:not(.btn):hover,
.page-wrapper .table tbody td a:not(.btn):focus {
  color: #334155;
}

.page-wrapper .table tbody td .text-muted,
.page-wrapper .table tbody td.text-muted,
.page-wrapper .table tbody td small,
.page-wrapper .table tbody td .small {
  color: #64748b !important;
}

.form-control,
.form-select {
  border-radius: 10px;
  border-color: #d1d5db;
}

.form-control:focus,
.form-select:focus {
  border-color: #bfc7d4;
  box-shadow: 0 0 0 0.2rem rgba(2, 117, 216, 0.08);
}

.left-sidebar .sidebar-link i.feather-icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

.left-sidebar .sidebar-link .hide-menu {
  white-space: normal;
  line-height: 1.25;
}

.topbar-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

.navbar-brand .app-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.navbar-brand a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.navbar-brand .app-logo-text {
  font-size: 1.65rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.3px;
}

.footer-link-ksj {
  color: inherit;
  text-decoration: none !important;
  font-weight: 600;
}

.footer-link-ksj:hover,
.footer-link-ksj:focus {
  color: inherit;
  text-decoration: none !important;
}

/* Shift dropdown submenu content to the right for clearer hierarchy. */
.left-sidebar .first-level {
  padding-left: 0.75rem;
}

.left-sidebar .first-level .sidebar-link {
  padding-left: 1.85rem !important;
  border-radius: 10px;
  margin: 0.1rem 0.45rem 0.1rem 0;
}

/* Highlight only for dropdown submenu items. */
.left-sidebar .first-level .sidebar-item .sidebar-link:hover {
  background: #eef2ff;
  color: #334155;
}

.left-sidebar .first-level .sidebar-item.active > .sidebar-link,
.left-sidebar .first-level .sidebar-link.active {
  background: linear-gradient(90deg, #eef2ff 0%, #e0e7ff 100%);
  color: #1e3a8a;
  font-weight: 600;
}

.badge.bg-dark {
  background: #111827 !important;
  color: #ffffff !important;
}

.ui-actionbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ui-actiontitle {
  margin: 0;
  font-weight: 600;
}

.ui-actionmeta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ui-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ui-btn-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

/* User preference: hide icons inside action buttons globally. */
.btn .ui-btn-icon {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  flex: 0 0 0 !important;
  margin: 0 !important;
}

.ui-toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

.ui-toolbar-actions .btn {
  min-width: 106px;
}

.ui-actionbar .ui-actions .btn {
  min-width: 108px;
}

.table td .btn-sm {
  min-width: 86px;
}

.table td .d-inline {
  display: inline-block !important;
  margin-left: 0.3rem;
}

.table td .d-inline:first-child {
  margin-left: 0;
}

.ui-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.ui-row-actions .d-inline {
  margin-left: 0 !important;
}

.table td.text-end {
  white-space: nowrap;
}

.table-dosen .col-name {
  min-width: 180px;
}

.table-dosen .col-nuptk {
  min-width: 140px;
  white-space: nowrap;
}

.table-dosen .col-email {
  min-width: 210px;
}

.table-dosen .dosen-role-form .form-select {
  min-width: 150px;
}

.table-dosen .dosen-role-form .btn-sm {
  min-width: 78px;
}

.table-dosen .dosen-actions .btn-sm {
  min-width: 70px;
}

.ui-filter-surface {
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.badge-status-submitted {
  background: #dbeafe;
  color: #111827 !important;
}

.badge-status-verified {
  background: #ede9fe;
  color: #111827 !important;
}

.badge.badge-status-verified {
  background: #ede9fe !important;
  color: #111827 !important;
}

.badge-status-scheduled {
  background: #ccfbf1;
  color: #111827 !important;
}

.badge-status-ongoing {
  background: #fde68a;
  color: #111827 !important;
}

.badge-status-finished {
  background: #bbf7d0;
  color: #111827 !important;
}

.badge-status-rejected {
  background: #dc3545;
  color: #fff !important;
}

.badge-status-neutral {
  background: #e2e8f0;
  color: #334155;
}

.badge-role-default {
  background: #64748b;
  color: #fff !important;
}

.badge {
  font-weight: 600;
}

.form-label {
  font-weight: 500;
}

.fw-semibold {
  font-weight: 500 !important;
}

.ui-empty-state {
  padding: 1rem 0.75rem;
}

.ui-empty-card {
  padding: 1rem 0.75rem;
}

.ui-empty-icon {
  font-size: 1.55rem;
  color: #9ca3af;
  line-height: 1;
  margin-bottom: 0.45rem;
}

.ui-empty-title {
  font-weight: 600;
  color: #334155;
}

.ui-empty-text {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ui-status-timeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ui-status-node {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  color: #6b7280;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 500;
}

.ui-status-node.is-done {
  border-color: #0ea5e9;
  color: #0f172a;
  background: #f0f9ff;
}

.ui-status-node.is-current {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.ui-status-node.is-rejected {
  border-color: #dc3545;
  color: #842029;
  background: #f8d7da;
}

.ui-status-arrow {
  color: #94a3b8;
  font-size: 0.8rem;
}

.ui-rekap-detail-wide {
  max-width: 1560px;
  margin-left: auto;
  margin-right: auto;
}

.ui-page-wide {
  max-width: 1560px;
  margin-left: auto;
  margin-right: auto;
}

.ui-page-wide-dashboard {
  max-width: none;
  width: 100%;
}

.kaprodi-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 0.9rem;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 0.9rem;
}

.dashboard-card-plain {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: none !important;
}

.auth-page {
  min-height: 100vh;
  align-items: center !important;
  background:
    radial-gradient(1200px 520px at 12% -8%, rgba(99, 102, 241, 0.16), transparent 58%),
    radial-gradient(900px 460px at 88% 105%, rgba(14, 165, 233, 0.12), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.auth-shell {
  max-width: 560px;
}

.auth-shell-wide {
  max-width: 860px;
}

.auth-page-login {
  align-items: center !important;
  padding-top: max(12px, env(safe-area-inset-top));
}

.auth-brand {
  margin-bottom: 1.2rem;
}

.auth-brand-logo {
  width: auto;
  height: 88px;
  object-fit: contain;
}

.auth-brand-title {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  line-height: 1.38;
  font-weight: 500;
  color: #0f172a;
  text-wrap: balance;
}

.auth-card {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  margin-top: 0.2rem;
}

.auth-title {
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 500;
  color: #0f172a;
}

.auth-subtitle {
  font-size: 1.07rem;
  font-weight: 400;
}

.auth-label {
  font-size: 1.04rem;
  font-weight: 400;
  color: #0f172a;
}

.auth-input {
  min-height: 48px;
  border-radius: 12px;
  border-color: #cbd5e1;
  font-size: 1.03rem;
  font-weight: 400;
  padding-left: 0.82rem;
  padding-right: 0.82rem;
}

.auth-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.14);
}

.auth-submit {
  min-height: 50px;
  border-radius: 14px;
  font-size: 1.08rem;
  font-weight: 500;
}

.auth-links a {
  font-size: 0.95rem;
  font-weight: 400;
}

.auth-register-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.auth-register-btn {
  width: 100%;
  min-height: 44px;
  font-size: 0.96rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  white-space: nowrap;
}

.auth-page .form-text,
.auth-page .alert,
.auth-page .btn,
.auth-page .btn-light {
  font-weight: 400;
}

@media (max-width: 991.98px) {
  .kaprodi-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .auth-page {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    padding-top: max(18px, calc(env(safe-area-inset-top) + 8px));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .auth-shell,
  .auth-shell-wide {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .page-wrapper > .container-fluid {
    padding-top: 0.9rem;
    padding-bottom: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .btn,
  .form-control,
  .form-select {
    min-height: 40px;
  }

  .ui-actionbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .kaprodi-kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .admin-kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .auth-brand-logo {
    height: 72px;
  }

  .auth-brand-title {
    font-size: 0.95rem;
    line-height: 1.35;
    margin-top: 0.25rem;
    margin-bottom: 0.1rem;
  }

  .auth-title {
    font-size: 1.65rem;
  }

  .auth-subtitle {
    font-size: 0.95rem;
  }

  .auth-card {
    border-radius: 14px;
    margin-top: 0.45rem;
  }

  .auth-shell-wide {
    max-width: 100%;
  }

  .auth-page-login {
    padding-top: max(28px, calc(env(safe-area-inset-top) + 14px));
    align-items: flex-start !important;
  }

  .auth-register-actions {
    grid-template-columns: 1fr;
  }
}
