:root {
  --portal-primary: #a11b28;
  --portal-primary-dark: #7a111d;
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Header ---------- */
.portal-header {
  background: linear-gradient(90deg, var(--portal-primary), var(--portal-primary-dark));
}

.btn-notification,
.btn-profile {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}

.btn-notification:hover,
.btn-profile:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-profile {
  color: #fff;
}

.notif-dropdown {
  min-width: 320px;
}

/* ---------- Dashboard ---------- */
.dashboard-hero {
  background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-primary-dark) 100%);
  color: #fff;
  border-radius: 1rem;
}

.kpi-card {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.chart-card {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

/* ---------- Auth pages ---------- */
.auth-card {
  border-radius: 1rem;
  overflow: hidden;
}

.auth-brand-panel {
  background: linear-gradient(160deg, var(--portal-primary), var(--portal-primary-dark));
}

/* ---------- Left Sidebar ---------- */
.portal-body {
  min-height: calc(100vh - 64px);
}

.portal-sidebar {
  width: 250px;
  flex: 0 0 250px;
  background: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0.05rem 0 0.5rem rgba(0, 0, 0, 0.03);
  padding: 0.75rem 0;
  transition: width 0.2s ease, flex-basis 0.2s ease;
}

.portal-sidebar.sidebar-collapsed {
  width: 68px;
  flex: 0 0 68px;
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 0 0.5rem 0.9rem;
  border: none;
  border-radius: 0.5rem;
  background: #f4f4f6;
  color: var(--portal-primary);
  transition: background 0.15s ease, transform 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: #ece5e6;
}

.portal-sidebar.sidebar-collapsed .sidebar-toggle-btn i {
  transform: rotate(180deg);
}

.sidebar-toggle-btn i {
  transition: transform 0.2s ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  color: #495057;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  background: transparent;
  cursor: pointer;
}

.sidebar-link i:first-child {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: #f8eef0;
  color: var(--portal-primary);
}

.sidebar-link.active {
  background: #fbe9eb;
  color: var(--portal-primary);
  border-right: 3px solid var(--portal-primary);
  font-weight: 600;
}

.sidebar-caret {
  transition: transform 0.2s ease;
  font-size: 0.8rem;
}

.sidebar-group-toggle[aria-expanded="true"] .sidebar-caret {
  transform: rotate(180deg);
}

.sidebar-submenu {
  display: flex;
  flex-direction: column;
  padding: 0.15rem 0 0.35rem 0;
  background: #fcfafa;
}

.sidebar-sublink {
  padding: 0.5rem 1.1rem 0.5rem 3.05rem;
  color: #6c757d;
  text-decoration: none;
  font-size: 0.88rem;
}

.sidebar-sublink:hover {
  background: #f8eef0;
  color: var(--portal-primary);
}

.sidebar-sublink.active {
  color: var(--portal-primary);
  font-weight: 600;
}

/* Collapsed state: hide text labels + submenus, show icons only */
.portal-sidebar.sidebar-collapsed .sidebar-label,
.portal-sidebar.sidebar-collapsed .sidebar-caret,
.portal-sidebar.sidebar-collapsed .sidebar-submenu {
  display: none;
}

.portal-sidebar.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 0.65rem 0;
}

.portal-main {
  min-width: 0;
}

/* ---------- College Information / Staff forms ---------- */
.staff-info-card {
  border-radius: 1rem;
}

.staff-info-card .form-control:disabled,
.staff-info-card .form-control[readonly] {
  background-color: #f4f4f6;
  opacity: 1;
}

.per-details .card-header {
    background: #f9e0e3 !important;
    padding: 10px;
    border-color: #861421;
}

    .per-details .card-header h6 {
        color: #a11b28;
        margin-bottom: 0;
    }

.per-details table tr th {
    background: #861421;
    color: #fff;
}

.per-details table tr th, .per-details table tr td {
    border: solid 1px #f9e0e3;
}

.dashboard-gradient {
    background: linear-gradient(135deg, #f7eae8 0%, #fef8f5 100%);
    color: #000;
    border-radius: 10px !important;
}

.merit_list_new {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

    .merit_list_new h4 {
        color: #861421;
        font-weight: 600;
    }

    .merit_list_new .new-btns .btn {
        display: inline-block;
        width: 48% !important;
    }

    .merit_list_new .new-btns {
        text-align: center;
    }

        .merit_list_new .new-btns .btn.btn-primary {
            background: #861421;
            border-color: #861421;
        }

            .merit_list_new .new-btns .btn.btn-primary:hover {
                background: transparent;
                color: #861421;
            }

        .merit_list_new .new-btns .btn.btn-outline-secondary {
            border-color: #bf8f00;
            color: #bf8f00;
        }

            .merit_list_new .new-btns .btn.btn-outline-secondary:hover {
                background: #bf8f00;
                color: #fff;
            }

    .merit_list_new form input, .merit_list_new form select {
        border: solid 1px #ccc !important;
        box-shadow: none !important;
        outline: none !important;
    }

    @media (max-width:767px){
        .portal-sidebar {
            position: absolute;
            left: -100%;
            height: 100%;
            z-index: 9999;
            transition: 0.3s all ease;
        }

            .portal-sidebar.sidebar-collapsed {
                left: 0;
                width: auto;
            }

            .portal-sidebar span.sidebar-label {
                display: block !important;
            }

            .portal-sidebar.sidebar-collapsed .sidebar-link {
                justify-content: flex-start;
                padding: 0.65rem;
            }
    }