/* ============================================================
   MEVITY INVESTMENT SYSTEM - Custom CSS
   Primary: #0378d7  |  Secondary: #ce0203
   ============================================================ */

:root {
    --mis-primary: #0378d7;
    --mis-secondary: #ce0203;
    --mis-dark: #0a2b4e;
    --mis-light: #f4f7fb;
    --mis-warning: #ffd60a;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--mis-light);
    margin: 0;
    color: #1f2d3d;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* ============================================================
   SPINNER
   ============================================================ */
#mis-spinner {
    position: fixed;
    inset: 0;
    background: #002451;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
#mis-spinner.hide { opacity: 0; visibility: hidden; }
.spinner-content { text-align: center; }
.spinner-content img { width: 60px; height: 60px; object-fit: contain; margin-bottom: 10px; }
.spinner-content h4 {
    color: var(--mis-primary);
    font-weight: 700;
    letter-spacing: 3px;
    margin: 8px 0 4px;
    font-size: 18px;
}
.spinner-content p { color: #666; font-size: 13px; }
.spinner-ring {
    width: 45px; height: 45px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--mis-primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-body {
    background: linear-gradient(135deg, #0a2b4e 0%, #0378d7 100%);
    min-height: 100vh;
}

.login-navbar {
    background: #002451;
    padding: 14px 0;
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 1000;
}
.login-navbar .brand-text {
    font-weight: 700;
    font-size: 20px;
    color: #fff;
}
.login-navbar .brand-yellow { color: var(--mis-secondary); }
.login-navbar .nav-link {
    color: #fff !important;
    margin: 0 10px;
    font-weight: 500;
    font-size: 15px;
}
.login-navbar .nav-link:hover { color: var(--mis-secondary) !important; }

/* Mobile menu background */
@media (max-width: 991.98px) {
    .login-navbar .navbar-collapse {
        background: #0a2b4e;
        border-radius: 10px;
        padding: 12px 15px;
        margin-top: 10px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }
    .login-navbar .navbar-nav { gap: 4px; }
    .login-navbar .nav-link {
        margin: 0;
        padding: 10px 8px;
        border-radius: 8px;
    }
    .login-navbar .nav-link:hover { background: rgba(255, 255, 255, 0.08); }
    .login-navbar .btn-login-nav {
        display: block;
        width: 100%;
        margin-top: 6px;
        text-align: center;
    }
    .login-navbar .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.5);
    }
    .login-navbar .navbar-toggler-icon {
        filter: invert(1);
    }
}

.btn-login-nav {
    background: var(--mis-primary);
    color: #fff;
    border-radius: 30px;
    padding: 7px 20px;
    font-weight: 600;
    font-size: 14px;
    border: none;
}
.btn-login-nav:hover { background: #0366b8; color: #fff; }

/* ---- HERO SECTION: fupi na simple ---- */
.login-hero {
    padding: 90px 0 40px;   /* juu kwa ajili ya header, chini kidogo */
    display: flex;
    align-items: center;
}
.hero-left { padding-top: 10px; }
.hero-title {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 14px;
}
.hero-title .text-warning { color: var(--mis-secondary) !important; }
.hero-subtitle {
    font-size: 1rem;
    opacity: 0.92;
    margin-bottom: 20px;
    max-width: 480px;
}
.btn-get-in-touch {
    background: var(--mis-secondary);
    color: #ffffff;
    font-weight: 600;
    border-radius: 30px;
    padding: 10px 24px;
    font-size: 14px;
    border: none;
}
.btn-get-in-touch:hover { background: #0378d7; color: #ffffff; }

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 26px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.login-icon {
    width: 60px; height: 60px;
    background: var(--mis-primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto;
}
.login-card h3 { color: var(--mis-dark); font-weight: 700; font-size: 1.3rem; }

.input-group-custom {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 14px;
    transition: border 0.2s;
}
.input-group-custom:focus-within {
    border-color: var(--mis-primary);
    box-shadow: 0 0 0 3px rgba(3, 120, 215, 0.12);
}
.input-group-custom .form-control {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 12px 8px;
    font-size: 14px;
}
.input-group-custom .form-control:focus { box-shadow: none; }
.input-icon { color: #8a8a8a; font-size: 16px; }
.toggle-password {
    cursor: pointer;
    color: #8a8a8a;
    font-size: 16px;
    margin-left: 8px;
}
.btn-login {
    background: var(--mis-primary);
    border: none;
    border-radius: 10px;
    padding: 11px;
    font-weight: 600;
    font-size: 15px;
}
.btn-login:hover { background: #0366b8; }

/* ============================================================
   MOBILE TEXT SIZES (login page iwahi kuonekana)
   ============================================================ */
@media (max-width: 768px) {
    .login-hero { padding: 76px 0 30px; }
    .hero-title { font-size: 1.5rem; margin-bottom: 10px; }
    .hero-subtitle { font-size: 0.82rem; margin-bottom: 14px; line-height: 1.5; }
    .btn-get-in-touch { padding: 8px 18px; font-size: 12px; }
    .login-card { padding: 22px 18px; border-radius: 14px; }
    .login-card h3 { font-size: 1.1rem; }
    .login-card p { font-size: 0.8rem; }
    .login-icon { width: 50px; height: 50px; font-size: 22px; }
    .input-group-custom .form-control { padding: 10px 6px; font-size: 13px; }
    .btn-login { padding: 10px; font-size: 14px; }
    .login-navbar .brand-text { font-size: 17px; }
}

@media (max-width: 400px) {
    .hero-title { font-size: 1.3rem; }
    .hero-subtitle { font-size: 0.75rem; }
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact-section {
    background: #ffffff;
    padding: 55px 0 60px;
    scroll-margin-top: 70px;
}
.contact-title {
    font-weight: 700;
    color: var(--mis-dark);
    font-size: 1.9rem;
}
.contact-title .text-warning { color: #ce0203 !important; }
.contact-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}
.contact-card {
    background: #f8fafc;
    border: 1px solid #e8eef5;
    border-radius: 14px;
    padding: 26px 18px;
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s;
    height: 100%;
}
.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(3, 120, 215, 0.15);
}
.contact-icon {
    width: 56px; height: 56px;
    background: var(--mis-primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}
.contact-card h5 {
    font-weight: 600;
    color: var(--mis-dark);
    margin-bottom: 6px;
    font-size: 1rem;
}
.contact-card p {
    color: #5b6675;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Footer */
.login-footer {
    background: #071f38;
    color: #b8c4d3;
    padding: 16px 0;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .contact-section { padding: 40px 0 45px; }
    .contact-title { font-size: 1.4rem; }
    .contact-subtitle { font-size: 0.8rem; }
    .contact-card { padding: 20px 14px; }
    .contact-icon { width: 46px; height: 46px; font-size: 18px; }
    .contact-card h5 { font-size: 0.9rem; }
    .contact-card p { font-size: 0.8rem; }
}

/* ============================================================
   TABLES - Mobile Responsive (Card View)
   ============================================================ */
.table-responsive-custom { width: 100%; }

@media (max-width: 768px) {
    .table-card-view thead { display: none; }
    .table-card-view tbody tr {
        display: block;
        margin-bottom: 15px;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        padding: 10px;
    }
    .table-card-view tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        border: none;
        border-bottom: 1px dashed #eee;
    }
    .table-card-view tbody td:last-child { border-bottom: none; }
    .table-card-view tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--mis-primary);
        margin-right: 12px;
    }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary-mis { color: var(--mis-primary) !important; }
.text-secondary-mis { color: var(--mis-secondary) !important; }
.bg-primary-mis { background: var(--mis-primary) !important; color: #fff; }
.bg-secondary-mis { background: var(--mis-secondary) !important; color: #fff; }




/* ============================================================
   ADMIN STAT CARDS (Boreshwa)
   ============================================================ */
.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 16px;
    padding: 20px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 22px rgba(3, 120, 215, 0.07);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid #eef3f9;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--mis-primary);
    opacity: 0.9;
}
.stat-card.stat-success::before { background: #1aa35a; }
.stat-card.stat-warning::before { background: #e6a700; }
.stat-card.stat-secondary::before { background: var(--mis-secondary); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(3, 120, 215, 0.14);
}

.stat-card .stat-icon {
    width: 50px; height: 50px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 23px; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(3, 120, 215, 0.25);
}
.stat-primary .stat-icon { background: linear-gradient(135deg, #0378d7, #0560a8); }
.stat-success .stat-icon { background: linear-gradient(135deg, #1aa35a, #148049); box-shadow: 0 6px 16px rgba(26, 163, 90, 0.25); }
.stat-warning .stat-icon { background: linear-gradient(135deg, #f0b400, #d89a00); box-shadow: 0 6px 16px rgba(240, 180, 0, 0.25); }
.stat-secondary .stat-icon { background: linear-gradient(135deg, #ce0203, #a80102); box-shadow: 0 6px 16px rgba(206, 2, 3, 0.25); }

.stat-card .stat-label {
    font-size: 11.5px;
    color: #6b7785;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    margin-bottom: 2px;
}
.stat-card .stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    color: #0a2b4e;
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.stat-card small { font-size: 11px; color: #8a95a3; display: block; margin-top: 3px; }

.mini-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 18px rgba(3, 120, 215, 0.06);
    height: 100%;
    border: 1px solid #eef3f9;
    transition: transform 0.2s;
}
.mini-stat-card:hover { transform: translateY(-3px); }
.mini-stat-card i { font-size: 26px; }
.mini-stat-card .value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0a2b4e;
    line-height: 1.1;
}
.mini-stat-card .label { font-size: 12px; color: #6b7785; font-weight: 500; }

/* Tables katika dashboard */
.card .card-header {
    background: #fff;
    border-bottom: 1px solid #eef3f9;
    padding: 14px 18px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #0a2b4e;
}
.card .card-header strong { font-weight: 700; }

/* Responsive tweaks */
@media (max-width: 768px) {
    .stat-card { padding: 8px; gap: 10px; border-radius: 13px; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 11px; }
    .stat-card .stat-value { font-size: 11px; }
    .stat-card .stat-label { font-size: 10px; }
    .stat-card small { font-size: 10px; }
    .mini-stat-card { padding: 14px; }
    .mini-stat-card .value { font-size: 1.1rem; }
}


/* ============================================================
   CHART CARDS - SIZE YA KATI
   ============================================================ */
.chart-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 22px rgba(3, 120, 215, 0.07);
    border: 1px solid #eef3f9;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.22s;
}
.chart-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(3, 120, 215, 0.12);
}
.chart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 18px 0;
    gap: 10px;
}
.chart-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #0a2b4e;
    margin: 0 0 2px;
    letter-spacing: -0.2px;
}
.chart-card-header small { font-size: 11px; }
.chart-legend-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    color: #6b7785;
    background: #f4f7fb;
    padding: 4px 9px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}
.chart-body {
    padding: 12px 16px 16px;
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chart-body-bar {
    height: 260px;
    padding: 12px 16px 18px;
}
.chart-body-bar canvas {
    width: 100% !important;
    height: 100% !important;
}
.chart-pie-body {
    height: 230px;
    min-height: 230px;
    position: relative;
}
.chart-pie-body canvas {
    max-width: 230px !important;
    max-height: 230px !important;
    width: 100% !important;
    height: 100% !important;
}
.pie-center-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}
.pie-center-label strong {
    display: block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #0a2b4e;
    line-height: 1;
}
.pie-center-label small {
    font-size: 9.5px;
    color: #6b7785;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.chart-footer-legend {
    display: flex;
    justify-content: center;
    gap: 22px;
    padding: 0 16px 14px;
    font-size: 12px;
    color: #4a5a6a;
}
.chart-footer-legend > div {
    display: flex;
    align-items: center;
    gap: 6px;
}
.chart-footer-legend strong {
    color: #0a2b4e;
    margin-left: 4px;
}
.dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .chart-card-header { padding: 12px 14px 0; }
    .chart-title { font-size: 13px; }
    .chart-card-header small { font-size: 10px; }
    .chart-body { padding: 10px 12px 14px; }
    .chart-body-bar { height: 220px; }
    .chart-pie-body { height: 200px; min-height: 200px; }
    .chart-pie-body canvas { max-width: 200px !important; max-height: 200px !important; }
    .chart-footer-legend { font-size: 11px; gap: 16px; padding-bottom: 12px; }
    .pie-center-label strong { font-size: 1.1rem; }
    .pie-center-label small { font-size: 9px; }
}





/* ============================================================
   LOGIN FORMAT BOX (Hero Left)
   ============================================================ */
.login-format-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 18px 20px;
    margin: 18px 0 20px;
    backdrop-filter: blur(6px);
    max-width: 480px;
}
.login-format-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--mis-warning);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.login-format-title i { font-size: 16px; }

.login-format-desc {
    font-size: 13px;
    color: #e8f0f9;
    margin-bottom: 10px;
    line-height: 1.5;
}
.login-format-desc strong { color: #fff; font-weight: 600; }

.login-format-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
}
.login-format-list li {
    font-size: 12.5px;
    color: #dbe9f7;
    display: flex;
    align-items: center;
    gap: 7px;
}
.login-format-list li i {
    color: #4ade80;
    font-size: 12px;
    flex-shrink: 0;
}
.login-format-list li code {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11.5px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.2px;
}

.login-format-note {
    font-size: 12px;
    color: #c9d9ea;
    margin-bottom: 0;
    line-height: 1.6;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.18);
}
.login-format-note i {
    color: var(--mis-warning);
    margin-right: 4px;
}
.login-format-note strong { color: #fff; }

/* Mobile: format box ipunguzwe */
@media (max-width: 768px) {
    .login-format-box {
        padding: 14px 15px;
        margin: 14px 0 16px;
    }
    .login-format-title { font-size: 13px; }
    .login-format-desc { font-size: 11.5px; margin-bottom: 8px; }
    .login-format-list {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    .login-format-list li { font-size: 11.5px; }
    .login-format-list li code { font-size: 10.5px; }
    .login-format-note { font-size: 11px; padding-top: 8px; }
}

@media (max-width: 400px) {
    .login-format-box { padding: 12px; }
    .login-format-list li code { font-size: 10px; }
}