:root {
    --brand: #0f5132;
    --brand-dark: #0a3d26;
}

/* Cegah submenu sidebar yg sedang aktif "berkedip" saat halaman baru dimuat --
   Bootstrap Collapse pada dasarnya sudah tidak animasi elemen yg lahir dgn class
   "show", tapi browser kadang tetap sempat merender frame transisi sesaat sebelum
   CSS/JS selesai settle. body.preload mematikan SEMUA transition/animation dulu;
   dilepas oleh footer.php sesaat setelah load supaya toggle submenu oleh user
   (klik manual buka/tutup) tetap animasi seperti biasa. */
body.preload *,
body.preload *::before,
body.preload *::after {
    transition: none !important;
    animation-duration: 0s !important;
}

body {
    background-color: #f4f6f8;
    font-family: 'Poppins', "Segoe UI", Roboto, Arial, sans-serif;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Elegant typography: Poppins (body) + Playfair Display (headings) */
h1, h2, h3, h4, h5, h6,
.login-brand .brand-name, .login-form-card h4 {
    font-family: 'Playfair Display', serif;
}

/* Brand on the top-left (navbar) keep original sans stack for a familiar look */
.navbar-brand .brand-text, .brand-short, .brand-long {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.topbar {
    background-color: var(--brand);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-short {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-long {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    opacity: 0.85;
    text-transform: uppercase;
}

.app-wrapper {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(90deg, #e3f4ea 0 335px, #f4f6f8 335px 100%);
}

.sidebar {
    width: 335px;
    background-color: #e3f4ea;
    border-right: 1px solid #dfe9e2;
    padding-top: 1rem;
    flex-shrink: 0;
    height: 100%;
    max-height: calc(100vh - 56px);
    position: sticky;
    top: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 18px 30px rgba(15, 81, 50, 0.06), inset -1px 0 0 rgba(15, 81, 50, 0.06);
    transition: box-shadow 220ms ease;
}

.sidebar:hover {
    box-shadow: -14px 22px 44px rgba(15, 81, 50, 0.09), inset -1px 0 0 rgba(15, 81, 50, 0.06);
}

.sidebar .sidebar-menu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
    background-color: #e3f4ea;
}

.sidebar .sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar .sidebar-menu::-webkit-scrollbar-thumb {
    background-color: rgba(15, 81, 50, 0.22);
    border-radius: 999px;
}

.sidebar .nav-link {
    color: #333;
    padding: 0.65rem 1.1rem;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
   gap: 0.75rem;
    white-space: nowrap;
    font-size: 0.834rem; /* reduced by another ~1pt (≈1.333px) */
}

/* Ensure icons occupy a fixed column so text starts at the same x position */
.sidebar .nav-link i {
   font-size: 1.15rem;
   display: inline-block;
   width: 34px; /* fixed icon column width */
   min-width: 34px;
   text-align: center;
   line-height: 1;
   vertical-align: middle;
}

/* If nav-link contains extra wrappers (e.g., span > i), keep text aligned */
.sidebar .nav-link > span, .sidebar .nav-link > .me-1 + span {
   display: inline-block;
}

.sidebar .nav-link:hover {
    background-color: #f1f6f3;
}

.sidebar .nav-link.active {
    background-color: #e7f3ec;
    border-left-color: var(--brand);
    color: var(--brand);
    font-weight: 600;
}

.sidebar .submenu-toggle .submenu-caret {
    font-size: 0.75rem;
    width: auto;
    transition: transform 0.2s ease-in-out;
}

.sidebar .submenu-toggle.collapsed .submenu-caret {
    transform: rotate(-90deg);
}

.sidebar .submenu {
    background-color: #fafcfb;
}

.sidebar .submenu .nav-link {
    padding-left: 2.3rem;
    font-size: 0.717rem; /* reduced by another ~1pt */
}

.sidebar .sidebar-section-title {
    padding: 0.9rem 1.1rem 0.3rem;
    font-size: 0.744rem; /* +2pt drpd 0.577rem semula */
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6c8a78;
}

.sidebar .sidebar-section-title span {
    display: block;
    line-height: 1.35;
}

.sidebar .sidebar-section-title span + span {
    font-size: 0.704rem; /* +2pt drpd 0.537rem semula */
    font-weight: 600;
    opacity: 0.85;
}

.sidebar .sidebar-section-title--divider {
    margin-top: 0.4rem;
    padding-top: 0.9rem;
    border-top: 1px solid #d3e3d9;
}

.content-area {
    flex-grow: 1;
    min-width: 0;
    padding: 1.5rem;
    overflow-y: auto;
    height: 100%;
    min-height: 0;
    background-color: #f4f6f8;
}

.dashboard-shell .dashboard-hero {
   border: 0;
   border-radius: 1rem;
   background: linear-gradient(135deg, #f6fff9 0%, #edf8f0 100%);
   box-shadow: 0 16px 40px rgba(15, 81, 50, 0.12);
   overflow: hidden;
   position: relative;
}

.dashboard-shell .dashboard-hero::before {
   content: "";
   position: absolute;
   inset: auto -8% -28% auto;
   width: 240px;
   height: 240px;
   border-radius: 50%;
   background: radial-gradient(circle, rgba(25, 135, 84, 0.16) 0%, rgba(25, 135, 84, 0) 70%);
   pointer-events: none;
}

.dashboard-shell .dashboard-hero-icon {
   width: 46px;
   height: 46px;
   border-radius: 14px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   color: #fff;
   font-size: 1.15rem;
   background: linear-gradient(135deg, #198754 0%, #20c997 100%);
   box-shadow: 0 10px 22px rgba(25, 135, 84, 0.24);
}

.dashboard-shell .dashboard-pill {
   display: inline-flex;
   align-items: center;
   gap: 0.4rem;
   padding: 0.46rem 0.72rem;
   border-radius: 999px;
   background: rgba(255, 255, 255, 0.9);
   border: 1px solid rgba(25, 135, 84, 0.14);
   color: #166534;
   font-weight: 600;
   font-size: 0.9rem;
   box-shadow: 0 6px 16px rgba(15, 81, 50, 0.06);
}

.dashboard-shell .dashboard-hero-side {
   background: rgba(255, 255, 255, 0.9);
   border: 1px solid rgba(25, 135, 84, 0.12);
   border-radius: 0.95rem;
   padding: 1rem 1.1rem;
   backdrop-filter: blur(10px);
}

.dashboard-shell .stat-card {
   border: 1px solid rgba(15, 81, 50, 0.07);
   border-radius: 1rem;
   box-shadow: 0 10px 24px rgba(15, 81, 50, 0.06);
   transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-shell .stat-card:hover {
   transform: translateY(-2px);
   box-shadow: 0 16px 32px rgba(15, 81, 50, 0.12);
   outline: 1pt solid rgba(0,0,0,1);
   outline-offset: 0px;
}

.dashboard-shell .stat-card .card-body {
   position: relative;
   overflow: hidden;
}
 
.dashboard-shell .stat-card .card-body.icon-left {
   padding-left: 5.5rem;
}
 
 
.dashboard-shell .card-body.icon-left > i {
    position: absolute;
    left: 1.25rem;
    top: 1rem;
    font-size: 2.8rem;
    opacity: 1;
    z-index: 2;
}

.dashboard-shell .card-body.icon-left > i::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -40%);
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(25, 135, 84, 0.12) 0%, rgba(25, 135, 84, 0) 72%);
    pointer-events: none;
    z-index: 1;
}

.dashboard-shell .card-body:not(.icon-left) > i {
    position: relative;
    display: inline-block;
    opacity: 1;
    z-index: 2;
}

.dashboard-shell .card-body:not(.icon-left) > i::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(25, 135, 84, 0.12) 0%, rgba(25, 135, 84, 0) 72%);
    pointer-events: none;
    z-index: 1;
}


.dashboard-shell .card-header {
   border-bottom: 1px solid rgba(15, 81, 50, 0.08);
}

/* Chart canvas shadow to give charts more depth */
.card-body canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
    box-shadow: 0 12px 28px rgba(16,24,32,0.10);
    border-radius: 8px;
    background-clip: padding-box;
}

.dashboard-shell .list-group-item {
   transition: background-color 0.2s ease;
}

.dashboard-shell .list-group-item:hover {
   background-color: rgba(25, 135, 84, 0.04);
   border-radius: 0.6rem;
}

.dashboard-shell .progress {
   background-color: rgba(15, 81, 50, 0.08);
}

/* Supaya baris yang dituju lewat anchor (mis. #jam-12 di Jadwal Mengajar
   setelah simpan/hapus) tidak mepet ke tepi atas layar. */
tr[id^="jam-"] {
   scroll-margin-top: 90px;
}

.app-footer {
    text-align: center;
    font-size: 0.78rem;
    color: #8a938d;
    background-color: #eef8f1;
    border-top: 1px solid #dcefe2;
    padding: 0.75rem 1rem;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 20;
}

/* ---------- Login (split-screen) ---------- */

.login-split {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1 1 70%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #eff7ef 0%, #dff2de 22%, #e6f1e4 100%);
    padding: 2.25rem 3rem;
    display: flex;
    flex-direction: column;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 81, 50, 0.1);
    box-shadow: 0 12px 28px rgba(15, 81, 50, 0.08);
    align-self: flex-start;
    width: auto;
}

.login-brand img {
    height: 40px;
    width: auto;
}

.login-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.login-brand .brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: 0.05em;
}

.login-brand .brand-subtitle {
    font-size: 0.78rem;
    color: #2f523e;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.login-heading {
    max-width: 480px;
    margin-top: 2.75rem;
}

.login-heading h1 {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1b2e23;
    line-height: 1.25;
}

.login-heading h1 .accent {
    color: var(--brand);
}

.login-heading p {
    color: #5c6d64;
    margin-top: 0.5rem;
}

.login-illustration-wrap {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 0.5rem 0;
}

.login-illustration-wrap img {
    width: 100%;
    max-width: 480px;
    height: auto;
}

.login-illustration-stage {
    position: relative;
    width: 100%;
    max-width: 480px;
}

.login-illustration-stage .illustration-building {
    width: 100%;
    height: auto;
    display: block;
}

.login-illustration-stage .illustration-people {
    position: absolute;
    left: 50%;
    bottom: -3%;
    width: 108%;
    max-width: none;
    height: auto;
    transform: translateX(-50%);
    filter: drop-shadow(0 10px 14px rgba(15, 81, 50, 0.25));
}

.login-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    border-top: 1px solid rgba(15, 81, 50, 0.12);
    padding-top: 1.1rem;
}

.login-feature-row .feat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #3c4d44;
    white-space: nowrap;
}

.login-feature-row .feat i {
    color: var(--brand);
    font-size: 1rem;
}

.login-right {
    flex: 1 1 30%;
    max-width: 100%;
    background: #f4f7f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    box-shadow: -6px 0 24px rgba(15, 81, 50, 0.06);
}

.login-right-inner {
    width: 100%;
    max-width: 420px;
}

.login-form-card {
    background: #ffffff;
    border-radius: 1.1rem;
    padding: 2.4rem 3rem;
    box-shadow: 0 14px 34px rgba(15, 81, 50, 0.14), 0 3px 10px rgba(15, 81, 50, 0.08);
}
 
.login-card-logo-img {
    height: 242px;
    width: auto;
}

.login-form-card h4 {
    font-weight: 700;
    color: #1b2e23;
    font-size: 1.8rem;
}

.login-form-card h4.login-app-name {
    font-size: 1.2rem;
    white-space: nowrap;
}

.login-form-card p.small {
    font-size: 1rem !important;
}

.login-form-card .form-label {
    font-size: 1.05rem;
}

.login-form-card .form-control,
.login-form-card .input-group-text {
    padding: 0.55rem 0.95rem;
    font-size: 1.05rem;
}

.login-form-card .btn {
    font-size: 1.1rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

@media (max-width: 991.98px) {
    .login-left {
        display: none;
    }
    .login-right {
        flex: 1 1 100%;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .login-form-card {
        padding: 1.75rem 1.25rem;
        border-radius: 0.85rem;
    }
    .login-form-card h4.login-app-name {
        font-size: 1.05rem;
        white-space: normal;
    }
    .login-form-card .form-control,
    .login-form-card .input-group-text {
        padding: 0.5rem 0.8rem;
        font-size: 1rem;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -345px;
        bottom: 0;
        z-index: 1030;
        transition: left .2s ease-in-out;
        overflow-y: auto;
    }
    .sidebar.show {
        left: 0;
    }
}
