/* ==========================================================
   SIMA SMART - Sistem Manajemen Akreditasi Sekolah
   ========================================================== */

:root {
    --akr-primary: #0d47a1;
    --akr-primary-dark: #08306b;
    --akr-accent: #f5a623;
    --akr-sidebar-bg: #0d1b2a;
    --akr-sidebar-hover: #1b3a5c;
    --akr-bg: #f4f6f9;
}

body {
    background-color: var(--akr-bg);
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

/* ---------- Navbar ---------- */
.akr-navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.akr-navbar .brand {
    font-weight: 700;
    color: var(--akr-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Sidebar ---------- */
.akr-sidebar {
    background: var(--akr-sidebar-bg);
    min-height: calc(100vh - 57px);
    width: 250px;
    flex-shrink: 0;
    color: #fff;
    overflow-y: auto;
}

.akr-sidebar .nav-link {
    color: #cbd5e1;
    padding: .65rem 1.25rem;
    border-radius: 6px;
    margin: 2px 8px;
    font-size: .92rem;
    cursor: pointer;
}

.akr-sidebar .nav-link:hover,
.akr-sidebar .nav-link.active {
    background: var(--akr-sidebar-hover);
    color: #fff;
}

.akr-sidebar .sidebar-heading {
    color: #7c8ba1;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 1rem 1.25rem .5rem;
    margin-top: .25rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.akr-sidebar .sidebar-heading:first-of-type {
    border-top: none;
    margin-top: 0;
}

/* ---------- Grup menu collapsible (accordion) ---------- */
.akr-sidebar .sidebar-group-toggle {
    font-weight: 600;
    font-size: .88rem;
    border-top: 1px solid rgba(255,255,255,.08);
    border-radius: 0;
    margin: 0;
    padding: .8rem 1.25rem;
}

.akr-sidebar .sidebar-group-toggle:first-child {
    border-top: none;
}

.akr-sidebar .sidebar-group-toggle .chevron {
    transition: transform .2s ease;
}

.akr-sidebar .sidebar-group-toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.akr-sidebar .sidebar-group-toggle[aria-expanded="true"] {
    color: #fff;
}

.akr-sidebar .sidebar-subgroup {
    padding: 2px 0 6px;
}

.akr-sidebar .sidebar-subgroup .nav-link {
    padding-left: 2.1rem;
    font-size: .87rem;
}

/* ---------- Layout ---------- */
.akr-content {
    flex: 1;
    min-width: 0;
    padding: 1.75rem;
}

.akr-wrapper {
    display: flex;
    align-items: flex-start;
}

/* ---------- Kartu ringkasan dashboard ---------- */
.akr-card-stat {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.akr-card-stat .icon-box {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}

/* ---------- Tombol ---------- */
.btn-akr-primary {
    background: var(--akr-primary);
    border: none;
    color: #fff;
}

.btn-akr-primary:hover {
    background: var(--akr-primary-dark);
    color: #fff;
}

/* ---------- Responsif ---------- */
.akr-sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .akr-sidebar {
        position: fixed;
        top: 57px;
        bottom: 0;
        left: -270px;
        width: 270px;
        z-index: 1050;
        transition: left .25s ease-in-out;
        box-shadow: 4px 0 20px rgba(0,0,0,.25);
    }
    .akr-sidebar.show {
        left: 0;
    }

    .akr-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 57px 0 0 0;
        background: rgba(0,0,0,0);
        pointer-events: none;
        z-index: 1040;
        transition: background .25s ease-in-out;
    }
    .akr-sidebar-backdrop.show {
        background: rgba(0,0,0,.45);
        pointer-events: auto;
    }

    .akr-content {
        padding: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .akr-content {
        padding: 1rem .75rem;
    }
    .akr-card-stat .icon-box {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
    .card-body {
        padding: 1rem;
    }
    .table-responsive {
        font-size: .85rem;
    }
    .modal-dialog {
        margin: .75rem;
    }
}

/* Body tidak bisa discroll saat sidebar mobile terbuka */
body.akr-sidebar-open {
    overflow: hidden;
}

/* ---------- Pusat Notifikasi ---------- */
.akr-notif-panel {
    width: 340px;
    max-width: calc(100vw - 24px);
    max-height: 420px;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.akr-notif-item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .65rem .9rem;
    font-size: .85rem;
    white-space: normal;
    border-left: 3px solid transparent;
}

.akr-notif-item:hover {
    background: #f4f6f9;
}

.akr-notif-lewat {
    border-left-color: #c62828;
}
.akr-notif-lewat i {
    color: #c62828;
}

.akr-notif-segera {
    border-left-color: #f57c00;
}
.akr-notif-segera i {
    color: #f57c00;
}

.akr-notif-info {
    border-left-color: #0d47a1;
}
.akr-notif-info i {
    color: #0d47a1;
}

/* ---------- Widget Chat AI Mengambang ---------- */
.akr-ai-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1065;
}

.akr-ai-bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--akr-primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform .15s ease;
}
.akr-ai-bubble:hover {
    transform: scale(1.06);
    background: var(--akr-primary-dark);
}

.akr-ai-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53935;
    border: 2px solid #fff;
}

.akr-ai-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 340px;
    max-width: calc(100vw - 24px);
    height: 480px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.akr-ai-panel-header {
    background: var(--akr-primary);
    color: #fff;
    padding: .7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.akr-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: .85rem;
    background: #f4f6f9;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.akr-ai-msg {
    max-width: 88%;
    padding: .5rem .75rem;
    border-radius: 12px;
    font-size: .85rem;
    line-height: 1.4;
}
.akr-ai-msg-bot {
    background: #fff;
    border: 1px solid #e5e7eb;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.akr-ai-msg-user {
    background: var(--akr-primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}
.akr-ai-loading {
    color: #888;
    font-style: italic;
}

.akr-ai-explain {
    margin-top: .4rem;
    font-size: .74rem;
    color: #666;
    border-top: 1px dashed #ddd;
    padding-top: .35rem;
}
.akr-ai-explain summary {
    cursor: pointer;
    color: var(--akr-primary);
}

.akr-ai-input-area {
    padding: .6rem;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .akr-ai-widget { right: 12px; bottom: 12px; }
    .akr-ai-panel {
        right: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
        height: calc(100vh - 90px);
    }
}
