/* ============================================================
   TEMA WARNA URSULINE ACADEMY — Berbasis Logo Serviam
   Hijau tua sebagai warna utama, putih sebagai warna sekunder
   ============================================================ */

:root {
    /* === WARNA UTAMA === */
    --primary:          #1C5C28;   /* Hijau tua — warna perisai & salib logo */
    --primary-dark:     #0D3B17;   /* Hijau sangat gelap — outline logo, hover state */
    --primary-light:    #2E7D32;   /* Hijau medium — button hover, aksen aktif */
    --primary-pale:     #E8F5E9;   /* Hijau sangat muda — background card aktif */
    --primary-muted:    #A5C8A8;   /* Hijau muted — border card, divider */

    /* === WARNA SEKUNDER & AKSEN === */
    --secondary:        #FFFFFF;   /* Putih — teks logo, latar bersih */
    --accent-gold:      #D4A820;   /* Gold — untuk badge premium / sertifikat */
    --accent-gold-dark: #A07810;   /* Gold gelap — hover badge gold */

    /* === STATUS SEMANTIK === */
    --success:          #1B8C3A;   /* Hijau sukses (lulus, valid, selesai) */
    --success-bg:       #E8F5E9;
    --warning:          #D4820A;   /* Amber — peringatan, belum lengkap */
    --warning-bg:       #FFF8E1;
    --danger:           #B71C1C;   /* Merah — tidak lulus, ditolak */
    --danger-bg:        #FFEBEE;
    --info:             #1565C0;   /* Biru informasi — notifikasi umum */
    --info-bg:          #E3F2FD;
    --locked:           #78909C;   /* Abu-abu — submodul terkunci */
    --locked-bg:        #ECEFF1;

    /* === SIDEBAR === */
    --sidebar-bg:       #0D3B17;   /* Hijau sangat gelap — sidebar utama */
    --sidebar-bg-hover: #1C5C28;   /* Hijau tua — hover item sidebar */
    --sidebar-active:   #2E7D32;   /* Hijau medium — item aktif sidebar */
    --sidebar-text:     #C8E6C9;   /* Hijau muda — teks sidebar */
    --sidebar-text-muted: #81C784; /* Hijau muted — subtext/icon sidebar */
    --sidebar-border:   #1C5C28;   /* Border antar item sidebar */
    --sidebar-logo-bg:  #0A2E12;   /* Latar logo di sidebar (lebih gelap) */

    /* === TOPBAR === */
    --topbar-bg:        #1C5C28;   /* Hijau tua — topbar */
    --topbar-text:      #FFFFFF;
    --topbar-border:    #0D3B17;

    /* === BACKGROUND & SURFACE === */
    --body-bg:          #F5F8F2;   /* Putih gading bernuansa hijau — latar halaman */
    --card-bg:          #FFFFFF;
    --card-border:      #D0E8D2;   /* Border card bernuansa hijau sangat muda */
    --card-shadow:      0 2px 12px rgba(28, 92, 40, 0.08);
    --card-shadow-hover:0 6px 24px rgba(28, 92, 40, 0.15);

    /* === TEKS === */
    --text-primary:     #1B2E1D;   /* Hampir hitam bernuansa hijau — teks utama */
    --text-secondary:   #4A6B4D;   /* Hijau tua sedang — teks sekunder */
    --text-muted:       #7A9E7D;   /* Hijau muted — teks placeholder */
    --text-on-primary:  #FFFFFF;   /* Teks di atas background hijau tua */

    /* === TABEL === */
    --table-header-bg:  #1C5C28;
    --table-header-text:#FFFFFF;
    --table-row-hover:  #F0F8F1;
    --table-border:     #D0E8D2;

    /* === FORM === */
    --input-border:     #A5C8A8;
    --input-focus:      #1C5C28;
    --input-focus-shadow: 0 0 0 0.2rem rgba(28, 92, 40, 0.20);

    /* === PROGRESS BAR === */
    --progress-bg:      #C8E6C9;
    --progress-fill:    #1C5C28;

    /* === BADGE KHUSUS === */
    --badge-lulus:      #1B8C3A;
    --badge-proses:     #1C5C28;
    --badge-terkunci:   #78909C;
    --badge-tidak-lulus:#B71C1C;
    --badge-revisi:     #D4820A;
}

/* Base Body Styles */
body {
    background-color: var(--body-bg);
    color: var(--text-primary);
    font-family: 'Outfit', 'Inter', sans-serif;
    margin: 0;
    padding-top: 56px;
    padding-left: 260px;
    min-height: 100vh;
    transition: padding-left 0.3s ease-in-out;
}

/* Sidebar Kiri */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    left: 0; 
    top: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    z-index: 1010;
    transition: transform 0.3s ease-in-out;
}

.sidebar-brand {
    background-color: var(--sidebar-logo-bg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand img {
    height: 40px; 
    width: auto;
}

.sidebar-brand span {
    color: #FFFFFF;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.sidebar-menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.sidebar-item a {
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-item a:hover {
    background-color: var(--sidebar-bg-hover);
    color: #FFFFFF;
}

.sidebar-item.active a {
    background-color: var(--sidebar-active);
    color: #FFFFFF;
    border-left: 4px solid var(--accent-gold);
    font-weight: 600;
}

.sidebar-header {
    color: var(--sidebar-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px 5px 20px;
}

/* Topbar Atas */
.topbar {
    background-color: var(--topbar-bg);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 2px solid var(--topbar-border);
    position: fixed;
    top: 0; 
    left: 260px; 
    right: 0;
    z-index: 1000;
    transition: left 0.3s ease-in-out;
}

.topbar .page-title {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.topbar .topbar-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar .nav-icon-btn {
    color: var(--sidebar-text);
    background: none;
    border: none;
    position: relative;
    padding: 8px;
    cursor: pointer;
    transition: color 0.15s;
}

.topbar .nav-icon-btn:hover {
    color: #FFFFFF;
}

.topbar .badge-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--danger);
    color: #FFFFFF;
    border-radius: 50%;
    font-size: 10px;
    padding: 3px 6px;
    line-height: 1;
}

.topbar .avatar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
    text-decoration: none;
}

.topbar .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--sidebar-text);
}

.main-content {
    padding: 24px;
}

/* Overrides Bootstrap 5 */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    box-shadow: var(--input-focus-shadow) !important;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover, .btn-outline-primary:active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #FFFFFF !important;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 24px;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--card-border);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Cards Stat */
.card-stat {
    border-left: 5px solid var(--primary);
}

.card-stat.stat-warning {
    border-left-color: var(--warning);
}

.card-stat.stat-danger {
    border-left-color: var(--danger);
}

.card-stat.stat-success {
    border-left-color: var(--success);
}

.card-stat .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0;
}

.card-stat .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: var(--input-focus);
    box-shadow: var(--input-focus-shadow);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

/* Table styling */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table thead th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    font-weight: 600;
    padding: 12px 16px;
    border: none;
}

.table thead th:first-child {
    border-top-left-radius: 8px;
}

.table thead th:last-child {
    border-top-right-radius: 8px;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--table-border);
    color: var(--text-primary);
    font-size: 14px;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--table-row-hover);
}

/* Progress bar */
.progress {
    background-color: var(--progress-bg);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--progress-fill);
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

.bg-primary { background-color: var(--primary) !important; color: #fff !important; }
.bg-success { background-color: var(--success) !important; color: #fff !important; }
.bg-warning { background-color: var(--warning) !important; color: #fff !important; }
.bg-danger { background-color: var(--danger) !important; color: #fff !important; }
.bg-secondary { background-color: var(--locked) !important; color: #fff !important; }

/* Submodule Cards */
.submodul-card {
    transition: all 0.2s ease;
}

.submodul-card .btn {
    font-size: 12px;
}

/* 6-Phase Stepper */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #FFFFFF;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.stepper-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.stepper-item::before {
    position: absolute;
    content: "";
    border-bottom: 2px solid var(--card-border);
    width: 100%;
    top: 20px;
    left: -50%;
    z-index: 2;
}

.stepper-item::after {
    position: absolute;
    content: "";
    border-bottom: 2px solid var(--card-border);
    width: 100%;
    top: 20px;
    left: 50%;
    z-index: 2;
}

.stepper-item:first-child::before {
    display: none;
}

.stepper-item:last-child::after {
    display: none;
}

.stepper-item .step-counter {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid var(--card-border);
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.stepper-item .step-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stepper-item.completed .step-counter {
    background-color: var(--success);
    border-color: var(--success);
    color: #FFFFFF;
}

.stepper-item.completed .step-name {
    color: var(--success);
}

.stepper-item.active .step-counter {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 0 0 4px var(--primary-pale);
}

.stepper-item.active .step-name {
    color: var(--primary);
    font-weight: 700;
}

.stepper-item.completed::before,
.stepper-item.completed::after,
.stepper-item.active::before {
    border-bottom-color: var(--success);
}

/* Toastr Custom Override */
.toast-success { background-color: var(--primary) !important; }
.toast-info    { background-color: var(--info) !important; }
.toast-warning { background-color: var(--warning) !important; }
.toast-error   { background-color: var(--danger) !important; }

/* Login Page Layout */
.login-body {
    background-color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
}

.login-card {
    width: 420px;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: none;
}

.login-header {
    text-align: center;
    padding: 40px 30px 10px 30px;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 16px;
}

.login-title {
    color: var(--primary-dark);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 0;
}

.login-form {
    padding: 20px 40px 40px 40px;
}

/* Dropzone styling */
.dropzone-custom {
    border: 2px dashed var(--primary-muted);
    background-color: var(--body-bg);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone-custom:hover {
    background-color: var(--primary-pale);
    border-color: var(--primary);
}

/* Responsive adjust */
@media (max-width: 991.98px) {
    body {
        padding-left: 0;
    }
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .topbar {
        left: 0;
    }
}
