/* ==========================================================================
   eSPPM — Tema ungu profesional.
   Komponen tambahan di atas Tailwind CSS (utiliti dimuatkan melalui CDN).
   ========================================================================== */

:root {
    --ungu-950: #2e1065;
    --ungu-900: #4c1d95;
    --ungu-800: #5b21b6;
    --ungu-700: #6d28d9;
    --ungu-600: #7c3aed;
    --ungu-500: #8b5cf6;
    --ungu-100: #ede9fe;
    --ungu-50:  #f5f3ff;
    --fuchsia:  #c026d3;
    --merah:    #dc2626;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; }

/* ---- Gradien ---------------------------------------------------------- */
.bg-gradient-brand {
    background: linear-gradient(165deg, #2e1065 0%, #4c1d95 50%, #5b21b6 100%);
}
.bg-gradient-hero {
    background:
        radial-gradient(900px 500px at 90% -10%, rgba(192, 38, 211, .45), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(124, 58, 237, .5), transparent 60%),
        linear-gradient(135deg, #2e1065 0%, #4c1d95 55%, #6d28d9 100%);
}
.bg-gradient-accent {
    background: linear-gradient(135deg, #7c3aed 0%, #a21caf 100%);
}
.text-gradient {
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---- Butang ------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .55rem 1.1rem; border-radius: .6rem; font-size: .875rem; font-weight: 600;
    line-height: 1.25rem; cursor: pointer; border: 1px solid transparent;
    transition: all .15s ease; text-decoration: none; white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--ungu-500); outline-offset: 2px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary {
    color: #fff; background: linear-gradient(135deg, #7c3aed 0%, #a21caf 100%);
    box-shadow: 0 6px 16px -6px rgba(124, 58, 237, .7);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline { color: var(--ungu-800); background: #fff; border-color: #ddd6fe; }
.btn-outline:hover { background: var(--ungu-50); border-color: #c4b5fd; }
.btn-light { color: var(--ungu-900); background: #fff; }
.btn-light:hover { background: var(--ungu-50); }
.btn-ghost-light { color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .18); }
.btn-lg { padding: .8rem 1.5rem; font-size: .95rem; border-radius: .75rem; }

.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: .5rem; color: #64748b;
    background: transparent; border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
}
.btn-icon:hover { background: var(--ungu-50); color: var(--ungu-700); }
.btn-icon-danger:hover { background: #fef2f2; color: var(--merah); }

/* ---- Borang ------------------------------------------------------------ */
.form-label { display: block; margin-bottom: .35rem; font-size: .8125rem; font-weight: 600; color: #334155; }
.form-label .req { color: var(--merah); }
.form-control {
    width: 100%; padding: .6rem .8rem; font-size: .875rem; color: #0f172a; background: #fff;
    border: 1px solid #cbd5e1; border-radius: .6rem; transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: #94a3b8; }
.form-control:focus { outline: none; border-color: var(--ungu-600); box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }
.form-control.is-invalid { border-color: var(--merah); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.form-control:disabled { background: #f1f5f9; color: #64748b; }
.form-hint { margin-top: .3rem; font-size: .75rem; color: #64748b; }
.form-error { margin-top: .3rem; font-size: .75rem; font-weight: 500; color: var(--merah); }
.form-check { width: 1rem; height: 1rem; accent-color: var(--ungu-600); }

/* ---- Kad --------------------------------------------------------------- */
.card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(76, 29, 149, .12);
}
.card-head { padding: 1rem 1.25rem; border-bottom: 1px solid #f1f5f9; }
.card-title { font-size: .95rem; font-weight: 700; color: #0f172a; }
.card-body { padding: 1.25rem; }

/* ---- Jadual ------------------------------------------------------------ */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl th {
    padding: .75rem 1.25rem; text-align: left; font-size: .7rem; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase; color: #64748b; background: #f8fafc;
    border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.tbl td { padding: .85rem 1.25rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: #334155; }
.tbl tbody tr:hover { background: #faf8ff; }
.tbl tbody tr:last-child td { border-bottom: 0; }

/* ---- Lencana ----------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600; line-height: 1.2;
}
.badge-slate  { background: #f1f5f9; color: #475569; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-purple { background: var(--ungu-100); color: var(--ungu-800); }
.badge-amber  { background: #fef3c7; color: #b45309; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }

/* ---- Menu sisi --------------------------------------------------------- */
.nav-title { padding: 1rem .75rem .4rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.nav-item {
    display: flex; align-items: center; gap: .75rem; margin-bottom: .15rem; padding: .6rem .75rem;
    border-radius: .6rem; font-size: .875rem; font-weight: 500; color: rgba(255, 255, 255, .75);
    text-decoration: none; transition: all .15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 3px 0 0 #e9d5ff; }
.nav-item.is-disabled { cursor: not-allowed; opacity: .5; }
.nav-item.is-disabled:hover { background: transparent; color: rgba(255, 255, 255, .75); }
.nav-soon { margin-left: auto; flex-shrink: 0; white-space: nowrap; padding: .05rem .45rem; border-radius: 999px; font-size: .62rem; font-weight: 600; background: rgba(255, 255, 255, .15); }

/* ---- Paginasi ---------------------------------------------------------- */
.pg-item {
    display: inline-flex; min-width: 2rem; height: 2rem; align-items: center; justify-content: center;
    padding: 0 .55rem; border-radius: .5rem; font-size: .8125rem; font-weight: 600; color: #475569;
    border: 1px solid #e2e8f0; background: #fff; text-decoration: none;
}
a.pg-item:hover { background: var(--ungu-50); border-color: #ddd6fe; color: var(--ungu-800); }
.pg-aktif { background: var(--ungu-600); border-color: var(--ungu-600); color: #fff; }
.pg-mati { opacity: .45; }

/* ---- Pelbagai ---------------------------------------------------------- */
.kad-statistik { position: relative; overflow: hidden; }
.kad-statistik::after {
    content: ''; position: absolute; right: -2rem; top: -2rem; width: 6rem; height: 6rem;
    border-radius: 999px; background: radial-gradient(circle, rgba(124, 58, 237, .14), transparent 70%);
}
.glass { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(10px); }

/* SweetAlert2 — padankan tema */
.swal2-popup { border-radius: 1rem !important; font-family: 'Inter', system-ui, sans-serif !important; }
.swal2-title { font-size: 1.15rem !important; color: #0f172a !important; }
.swal2-html-container { font-size: .9rem !important; color: #475569 !important; }
.swal2-styled.swal2-confirm {
    background: linear-gradient(135deg, #7c3aed 0%, #a21caf 100%) !important; border-radius: .6rem !important;
    font-weight: 600 !important; box-shadow: none !important;
}
.swal2-styled.swal2-cancel { border-radius: .6rem !important; font-weight: 600 !important; }
.swal2-styled.swal2-deny { border-radius: .6rem !important; }
