﻿/* --- 1. GLOBAL & BASE STYLES --- */
body {
    font-family: 'Nunito', sans-serif;
    background-color: #f4f7f6;
    overflow-x: hidden;
}

/* --- 2. SIDEBAR LOGIC --- */
.sidebar {
    height: 100vh;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #1d2b36;
    color: white;
    padding-top: 20px;
    box-shadow: 4px 0 15px rgba(0,0,0,0.05);
    z-index: 1050;
    transition: all 0.3s ease-in-out;
}

.sidebar-brand {
    padding: 10px 15px;
    margin-bottom: 20px;
    text-align: center;
    text-decoration: none;
    display: block;
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}

    .sidebar-brand img {
        max-width: 100%;
        height: 40px;
        object-fit: contain;
    }

/* SCOPED: Only style links inside the sidebar */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 20px;
    margin: 4px 15px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .sidebar .nav-link:hover,
    .sidebar .nav-link.active {
        background-color: rgba(255, 152, 0, 0.1) !important;
        color: #ff9800 !important;
    }

    .sidebar .nav-link i {
        width: 25px;
    }

/* --- 3. MAIN CONTENT & TOP NAVBAR --- */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
}

.top-navbar {
    background-color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.content-area {
    padding: 20px;
    flex-grow: 1;
}

/* --- 4. CARDS & UI COMPONENTS --- */
.card {
    border-radius: 15px;
    border: none;
    overflow: hidden; /* Prevents buttons/content from escaping rounded corners */
}

    /* Step Card Hover Effect */
    .card[style*="border-left"] {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

        .card[style*="border-left"]:hover {
            transform: translateX(5px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
        }

/* --- 5. TABS STYLING (High Contrast) --- */
.nav-tabs .nav-link {
    color: #6c757d;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    margin-right: 5px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .nav-tabs .nav-link:hover {
        color: #1d2b36;
        background-color: #e9ecef;
    }

    .nav-tabs .nav-link.active {
        color: #fff !important;
        background-color: #0d6efd !important;
        border-color: #0d6efd !important;
        box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
    }

/* --- 6. MOBILE RESPONSIVE LOGIC --- */
@media (max-width: 991.98px) {
    .sidebar {
        left: -260px;
    }

        .sidebar.show {
            left: 0;
        }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        top: 0;
        left: 0;
    }

        .sidebar-overlay.active {
            display: block;
        }

    .close-sidebar {
        display: block;
    }

    #sidebarToggle {
        display: block !important;
    }
}

/* Hidden elements on desktop, shown via @media */
.close-sidebar {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

#sidebarToggle {
    border: 1px solid #dee2e6; /* Add a subtle border */
    background: #fff; /* Match navbar or use a distinct color */
    border-radius: 8px;
    padding: 8px 15px;
    display: none; /* Hidden by default on desktop */
    cursor: pointer;
    transition: all 0.2s;
}

    #sidebarToggle:hover {
        background-color: #f8f9fa;
        border-color: #ff9800;
    }

    /* Ensure the icon itself has size and color */
    #sidebarToggle i {
        font-size: 1.25rem;
        color: #1d2b36;
    }

/* --- 7. RESPONSIVE TABLES --- */
@media (max-width: 767.98px) {
    .table-responsive-custom table,
    .table-responsive-custom thead,
    .table-responsive-custom tbody,
    .table-responsive-custom th,
    .table-responsive-custom td,
    .table-responsive-custom tr {
        display: block;
    }

        .table-responsive-custom thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }

    .table-responsive-custom tr {
        margin-bottom: 1rem;
        border: 1px solid #eee;
        border-radius: 12px;
        padding: 0.5rem;
        background: #fff;
    }

    .table-responsive-custom td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        text-align: right;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

        .table-responsive-custom td::before {
            content: attr(data-label);
            position: absolute;
            left: 15px;
            width: 45%;
            text-align: left;
            font-weight: bold;
            color: #6c757d;
            text-transform: uppercase;
            font-size: 0.75rem;
        }

        .table-responsive-custom td[data-label="Actions"] {
            justify-content: center;
            padding-left: 0 !important;
            border-top: 1px dashed #eee;
            margin-top: 10px;
            padding-top: 15px !important;
        }
}

/* --- 8. DHIVEHI / RTL SUPPORT --- */
.dhivehi-input {
    font-family: 'Faruma', 'MV Boli', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
}
