/* ===== Helpdesk IT — theme minimal di atas Bootstrap 5 =====
   Layout & komponen (btn, card, table, form, alert, grid) pakai Bootstrap.
   File ini hanya berisi: variabel tema, sidebar, banner, rich-text, dropzone.
*/

:root {
    --hd-primary: #1a1a2e;
    --hd-accent: #e94560;
    --bs-primary: #1a1a2e;
}

/* ===== Sidebar (Bootstrap tidak punya sidebar bawaan) ===== */
.sidebar {
    width: 268px;
    flex: none;
    background: linear-gradient(180deg, #1a1a2e 0%, #181830 55%, #14213d 100%);
    color: #e2e8f0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.side-logo {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #e94560, #ff7a59);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 8px 20px rgba(233, 69, 96, .4);
}

.side-avatar {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 1.1rem;
}

.side-label {
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #64748b;
    margin: .9rem .25rem .35rem;
    font-weight: 700;
}

/* nav-pills Bootstrap sebagai basis, tinggal warnai */
.sidebar .side-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #cbd5e1;
    font-weight: 600;
    font-size: .92rem;
    border-radius: .65rem;
}
.sidebar .side-link i { font-size: 1.05rem; }
.sidebar .side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar .side-link.active { background: #e94560; color: #fff; }
.sidebar .side-link.side-cta { background: rgba(5, 150, 105, .18); color: #a7f3d0; }
.sidebar .side-link.side-cta:hover,
.sidebar .side-link.side-cta.active { background: #059669; color: #fff; }
.sidebar .side-link.side-logout { color: #fca5a5; }
.sidebar .side-link.side-logout:hover { background: rgba(220, 38, 38, .18); color: #fecaca; }

/* Mobile: sidebar jadi offcanvas Bootstrap (geser dari kiri) */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        height: 100dvh;
        z-index: 1045;
        width: min(300px, 85vw);
    }
}

/* Desktop: kunci agar reset .offcanvas-lg Bootstrap tidak menimpa tema sidebar */
@media (min-width: 992px) {
    .sidebar.offcanvas-lg {
        background: linear-gradient(180deg, #1a1a2e 0%, #181830 55%, #14213d 100%) !important;
    }
    .sidebar .offcanvas-body {
        flex-grow: 1;
        overflow-y: auto;
        flex-direction: column;
    }
}

/* ===== Topbar ===== */
.topbar-user {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a2e, #e94560);
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

/* ===== Welcome banner (gradien per role) ===== */
.welcome-banner {
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}
.welcome-banner::after {
    content: '';
    position: absolute;
    right: -70px;
    top: -70px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    pointer-events: none;
}
.welcome-admin { background: linear-gradient(135deg, #1a1a2e 0%, #e94560 130%); }
.welcome-teknisi { background: linear-gradient(135deg, #0f172a 0%, #2563eb 130%); }
.welcome-pelapor { background: linear-gradient(135deg, #064e3b 0%, #059669 130%); }

/* Ikon angka statistik */
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: #eef2ff;
}

/* ===== Rich text hasil CKEditor ===== */
.rich-content { color: #334155; font-size: .95rem; line-height: 1.7; overflow-wrap: break-word; }
.rich-content p { margin: 0 0 10px; }
.rich-content ul, .rich-content ol { margin: 0 0 12px 20px; }
.rich-content h2, .rich-content h3, .rich-content h4 { color: #0f172a; margin: 14px 0 8px; }
.rich-content a { color: #2563eb; }
.rich-content blockquote { border-left: 3px solid #e94560; background: #fff5f6; margin: 0 0 12px; padding: 10px 14px; border-radius: 0 10px 10px 0; }
.rich-content pre { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
.rich-content code { background: #f1f5f9; color: #b91c1c; border-radius: 6px; padding: 2px 6px; }
.rich-content pre code { background: transparent; color: inherit; padding: 0; }
.rich-content table { width: 100%; margin-bottom: 1rem; }

/* ===== CKEditor: selaraskan dengan Bootstrap form ===== */
.ck-editor__editable { min-height: 220px; }
.ck.ck-toolbar { border-color: var(--bs-border-color) !important; }

/* ===== Dropzone lampiran ===== */
.dropzone {
    display: flex;
    gap: 14px;
    align-items: center;
    border: 1.5px dashed var(--bs-border-color);
    border-radius: .9rem;
    background: var(--bs-tertiary-bg);
    padding: 18px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--hd-accent); background: #fff5f6; }
.dz-icon {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hd-accent);
}

/* ===== Lampiran ===== */
.attach-preview { width: 100%; max-height: 320px; object-fit: contain; background: #fff; border: 1px solid var(--bs-border-color); border-radius: 10px; margin-bottom: 12px; }

/* ===== Login (sisa custom di luar Bootstrap utilities) ===== */
.guest-wrap { min-height: 100vh; }
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1a2e 45%, #16213e 75%, #0f3460 100%);
}
.login-brand-panel {
    background: linear-gradient(160deg, #1a1a2e 0%, #1c2440 55%, #0f3460 100%);
}
.brand-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e94560, #ff7a59);
    box-shadow: 0 12px 28px rgba(233, 69, 96, .45);
}
.bg-decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.bg-decor .blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; }
.bg-decor .b1 { width: 420px; height: 420px; background: #e94560; top: -120px; left: -120px; }
.bg-decor .b2 { width: 520px; height: 520px; background: #0f3460; bottom: -180px; right: -140px; }
.bg-decor .b3 { width: 260px; height: 260px; background: #533483; top: 35%; left: 55%; opacity: .35; }

/* ===== Alias kompatibilitas: class lama tetap tampil rapi ===== */
.status-badge, .priority-badge {
    display: inline-block;
    padding: .25em .65em;
    font-size: .75em;
    font-weight: 700;
    line-height: 1;
    border-radius: var(--bs-border-radius-pill);
    white-space: nowrap;
    vertical-align: baseline;
}
.status-open { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.status-in_progress { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.status-resolved { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.status-closed { background: var(--bs-secondary-bg-subtle); color: var(--bs-secondary-text-emphasis); }
.status-admin { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.status-teknisi { background: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); }
.status-pelapor { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.priority-low { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.priority-medium { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.priority-high { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.priority-critical { background: var(--bs-danger); color: #fff; }
