
/* ============================================================
   TEKADJE Modern UI Patch — compatible with CI4 + SB Admin
   ============================================================ */
:root {
    --modern-primary: #2563eb;
    --modern-primary-2: #0ea5e9;
    --modern-dark: #0f172a;
    --modern-muted: #64748b;
    --modern-bg: #f8fafc;
    --modern-card: #ffffff;
    --modern-border: rgba(148,163,184,.22);
    --modern-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    --modern-radius: 18px;
}

@keyframes modernFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modernSlideUp { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes modernShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes modernPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.055); } }
@keyframes modernSpin { to { transform: rotate(360deg); } }

body.modern-admin {
    background: var(--modern-bg);
}

body.modern-admin .sb-topnav {
    background: linear-gradient(135deg, #0f172a, #1e293b 55%, #0f766e) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .22);
}

body.modern-admin .sb-sidenav-dark {
    background: linear-gradient(180deg, #111827, #0f172a) !important;
}

body.modern-admin .sb-sidenav .nav-link {
    border-radius: 12px;
    margin: 2px 10px;
    transition: all .18s ease;
}
body.modern-admin .sb-sidenav .nav-link:hover,
body.modern-admin .sb-sidenav .nav-link.active {
    background: rgba(255,255,255,.09);
    transform: translateX(2px);
}

.modern-role-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .5rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    color: #dbeafe;
    background: rgba(59,130,246,.20);
    border: 1px solid rgba(191,219,254,.22);
}

.tekadje-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(37,99,235,.15), transparent 35%), rgba(248,250,252,.96);
    backdrop-filter: blur(10px);
    transition: opacity .35s ease, visibility .35s ease;
}
.tekadje-preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.tekadje-loader-card {
    min-width: 220px;
    padding: 24px 26px;
    border-radius: 24px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 28px 80px rgba(15,23,42,.16);
    border: 1px solid rgba(226,232,240,.8);
    text-align: center;
    animation: modernSlideUp .5s ease both;
}
.tekadje-loader-logo-wrap {
    width: 86px;
    height: 86px;
    margin: 0 auto 14px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(148,163,184,.25), 0 14px 30px rgba(15,23,42,.12);
    animation: modernPulse 1.5s ease-in-out infinite;
}
.tekadje-loader-logo { max-width: 68px; max-height: 68px; object-fit: contain; border-radius: 14px; }
.tekadje-loader-spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(37,99,235,.16);
    border-top-color: var(--modern-primary);
    margin: 8px auto 10px;
    animation: modernSpin .8s linear infinite;
}
.tekadje-loader-text { color: #475569; font-size: .82rem; font-weight: 700; letter-spacing: .02em; }

.modern-page { animation: modernFadeIn .45s ease both; }
.modern-hero {
    border-radius: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 54%, #0f766e 100%);
    color: #fff;
    padding: 24px 28px;
    box-shadow: var(--modern-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}
.modern-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,.11);
}
.modern-hero-kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .16em; color: rgba(255,255,255,.72); font-weight: 800; }
.modern-hero-title { font-weight: 850; letter-spacing: -.03em; }
.modern-hero-subtitle { color: rgba(255,255,255,.75); }
.modern-hero-badge { align-items: center; padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); font-weight: 700; z-index: 1; }

.modern-stat-card, .modern-card, .card {
    border-radius: var(--modern-radius) !important;
}
.modern-stat-card {
    border: 0 !important;
    color: #fff;
    overflow: hidden;
    box-shadow: var(--modern-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}
.modern-stat-card:hover { transform: translateY(-4px); box-shadow: 0 24px 60px rgba(15,23,42,.14); }
.modern-stat-card::after { content: ""; position: absolute; right: -34px; bottom: -34px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.13); }
.stat-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat-cyan { background: linear-gradient(135deg, #0891b2, #0ea5e9); }
.stat-red { background: linear-gradient(135deg, #dc2626, #f97316); }
.stat-green { background: linear-gradient(135deg, #16a34a, #059669); }
.modern-stat-icon { width: 40px; height: 40px; border-radius: 14px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.modern-stat-label { font-size: .73rem; color: rgba(255,255,255,.72); text-transform: uppercase; font-weight: 800; letter-spacing: .08em; }
.modern-stat-number { font-size: 2.1rem; font-weight: 850; line-height: 1; margin: 5px 0 12px; }
.modern-stat-link { color: rgba(255,255,255,.86); font-size: .78rem; font-weight: 700; text-decoration: none; position: relative; z-index: 1; }
.modern-stat-link:hover { color: #fff; text-decoration: none; }

.modern-card, body.modern-admin .card:not(.modern-stat-card) {
    border: 1px solid var(--modern-border) !important;
    box-shadow: var(--modern-shadow) !important;
    overflow: hidden;
}
.modern-card-header, body.modern-admin .card-header {
    background: rgba(255,255,255,.92) !important;
    border-bottom: 1px solid rgba(226,232,240,.85) !important;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modern-table thead, body.modern-admin table thead.table-light {
    background: #f8fafc !important;
    color: #64748b;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .04em;
}
body.modern-admin table tbody tr { transition: background .15s ease, transform .15s ease; }
body.modern-admin table tbody tr:hover { background: #f8fafc; }

.modern-badge-danger { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
.modern-badge-neutral { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.badge { border-radius: 999px; font-weight: 700; }

.form-control, .form-select, .dataTable-input {
    border-radius: 12px !important;
    border-color: #e2e8f0 !important;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.form-control:focus, .form-select:focus, .dataTable-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 .22rem rgba(59,130,246,.13) !important;
}
.was-invalid-shake, .is-invalid { animation: modernShake .38s ease; }
.invalid-feedback { animation: modernFadeIn .22s ease both; font-weight: 600; }

.btn { border-radius: 12px; font-weight: 700; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info { box-shadow: 0 10px 22px rgba(15,23,42,.08); }
.btn-modern-loading { position: relative; pointer-events: none; opacity: .86; }
.btn-modern-loading .modern-btn-spinner { width: 1rem; height: 1rem; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; display: inline-block; margin-right: .45rem; vertical-align: -2px; animation: modernSpin .75s linear infinite; }

.modal-content { border-radius: 20px !important; border: 0; box-shadow: 0 25px 80px rgba(15,23,42,.20); }
.modal-header { border-radius: 20px 20px 0 0; }
.alert { border-radius: 16px; border: 0; box-shadow: 0 12px 26px rgba(15,23,42,.06); }

.swal2-popup { border-radius: 22px !important; }
.swal2-confirm, .swal2-cancel { border-radius: 12px !important; font-weight: 800 !important; }

body.modern-auth .btn-auth { box-shadow: 0 14px 28px rgba(37,99,235,.25); }
body.modern-auth .auth-card { box-shadow: 0 30px 90px rgba(0,0,0,.42); }

@media (max-width: 575.98px) {
    .modern-hero { padding: 20px; border-radius: 20px; }
    .modern-hero-title { font-size: 1.45rem; }
    .modern-stat-number { font-size: 1.8rem; }
    .modern-stat-card .card-body { padding: 1rem; }
}
