/* Variables for consistency */

:root {
    --primary-blue: #1a73e8;
    --bg-gray: #f4f7f6;
    --sidebar-width: 260px;
    --transition: all 0.3s ease;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


/* --- Authentication Pages (Login, Signup, Forgot) --- */

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a73e8 0%, #00d4ff 100%);
}


.form-container {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}


.logo-circle {
    width: 70px;
    height: 70px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 15px auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


.form-header {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}


/* Sliding Controls */

.slide-controls {
    display: flex;
    height: 45px;
    width: 100%;
    margin: 25px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    position: relative;
    background: #f9f9f9;
}


    .slide-controls .slide {
        height: 100%;
        width: 100%;
        z-index: 1;
        color: #555;
        font-size: 16px;
        font-weight: 500;
        text-align: center;
        line-height: 45px;
        cursor: pointer;
        transition: var(--transition);
    }


    .slide-controls .slider-tab {
        position: absolute;
        height: 100%;
        width: 50%;
        left: 0;
        z-index: 0;
        border-radius: 7px;
        background: var(--primary-blue);
        transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }


input[type="radio"] {
    display: none;
}

#signup:checked ~ .slider-tab {
    left: 50%;
}


/* Form Fields */

.field {
    width: 100%;
    margin-top: 15px;
}

    .field input, .role-select {
        width: 100%;
        height: 45px;
        padding: 0 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 15px;
        outline: none;
        text-align: left;
    }


.btn-layer {
    width: 100%;
    height: 45px;
    background: var(--primary-blue);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}


/* --- Dashboard Structure --- */

.dashboard-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-gray);
    overflow-x: hidden;
}


.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    height: 100vh;
    position: sticky;
    top: 0;
}


.sidebar-header {
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.logo {
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}


.nav-links {
    display: flex;
    flex-direction: column;
}


    .nav-links a {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        padding: 15px 25px;
        display: flex;
        align-items: center;
        gap: 15px;
        transition: 0.2s;
    }


        .nav-links a:hover, .nav-links a.active {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

/* Submenu hidden by default */

.submenu {
    display: none;
    background: rgba(0, 0, 0, 0.2); /* Darker background for depth */
}


    /* Indent submenu links */

    .submenu a {
        padding-left: 50px !important;
        font-size: 0.9em;
    }


/* Rotate arrow when active */

.arrow {
    margin-left: auto;
    transition: 0.3s;
    font-size: 12px;
}


.rotate {
    transform: rotate(90deg);
}


/* Show submenu when this class is added via JS */

.submenu.show {
    display: block;
}


/* --- Main Content & Header --- */

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex items from overflowing */
}


.top-header {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}


.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}


.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}


.avatar {
    background: #ccc;
    color: #555;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* --- Welcome Card (Image 2 Look) --- */


/* Container adjustment */

#main-content-bg {
    display: flex;
    flex-direction: column; /* Stack top to bottom */
    gap: 30px;
    padding: 40px;
    border-radius: 20px;
    background: linear-gradient(rgba(26, 115, 232, 0.5), rgba(26, 115, 232, 0.5)), url('../images/dbbg.jpg'); /* Use your tax/accounting image */
    background-size: cover;
    background-position: center;
}


.content-body {
    padding: 30px;
    flex: 1;
}


/* Wide Welcome Card */

.welcome-card-wide {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    width: 100%; /* Full width */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}


    .welcome-card-wide h3 {
        color: var(--primary-blue);
        margin-bottom: 5px;
        font-size: 24px;
    }


.welcome-card p {
    color: #777;
}


/* Row for the 3 boxes */

.stats-row {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap; /* Allows wrapping on small screens */
}


/* Individual Glass Box */

.glass-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    flex: 1; /* Makes all 3 boxes equal width */
    min-width: 200px;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: 0.3s ease;
}


    .glass-box:hover {
        transform: translateY(-5px);
        background: rgba(255, 255, 255, 0.95);
    }


.box-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}


.box-data {
    display: flex;
    flex-direction: column;
}


.box-number {
    font-size: 22px;
    font-weight: 800;
    color: #222;
}


.box-text {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}




/* --- Responsive Menu Rules --- */


.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--primary-blue);
    cursor: pointer;
}


@media (max-width: 768px) {

    .menu-toggle {
        display: block;
    }


    .sidebar {
        position: fixed;
        left: -250px;
        z-index: 1000;
    }


        .sidebar.active {
            left: 0;
        }


    /*.close-sidebar {

        display: block;

        background: none;

        border: none;

        color: white;

        font-size: 28px;

        cursor: pointer;

    }*/


    .top-header {
        padding: 15px 20px;
    }


    .content-body {
        padding: 20px;
    }
}


.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Option A: Using a Background Image */
    background: linear-gradient(rgba(26, 115, 232, 0.8), rgba(0, 212, 255, 0.8)), url('82454934_9936920.jpg'); /* Replace with your image file */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Adding a bit of blur to the background helps the card pop */
    backdrop-filter: blur(2px);
}


/* Make the form container slightly transparent for a glass effect */

.form-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3); /* Stronger shadow for depth */
}


.auth-wrapper {
    background-color: #1a73e8;
    background-image: radial-gradient(at 0% 0%, hsla(213,94%,56%,1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(189,100%,46%,1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(220,100%,50%,1) 0, transparent 50%);
    background-size: cover;
}


/* Entry Form Layout */

.entry-form-container {
    display: grid;
    grid-template-columns: 1fr 350px; /* Main form left, Table right */
    gap: 25px;
    align-items: start;
}


.form-main, .form-sidebar-table {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}


.field-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    flex: 1 1 200px; /* Boxes will be at least 200px before stacking */
    
}


    .field-group label {
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 5px;
        color: #260ac2;
    }


    .field-group input, .field-group select, .field-group textarea {
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 14px;
        
    }


.readonly-input {
    background-color: #f9f9f9;
    color: #e67e22;
    font-weight: bold;
}


/* Horizontal row for Date and Type */

.form-row.inline {
    display: flex;
    flex-wrap:wrap;
    gap: 20px;
    width:100%;
    padding:10px;
}

@media (max-width: 768px) {
    .header-inline-row {
        flex-direction: column; /* Forces vertical stacking */
    }

    .field-group {
        width: 100% !important; /* Makes each input group 100% wide */
    }

    .box {
        width: 100%; /* Ensures the textbox fills the screen */
    }

    /* Fixes the blue background cutting off */
    #main-content-bg {
        height: auto !important;
        padding-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .field-group {
        width: calc(50% - 10px); /* Two boxes side-by-side on small phones */
    }

    /* Fixes the blue background cutting off */
    #main-content-bg {
        height: auto !important;
        padding-bottom: 30px;
    }
}


/* Table Styling */

.table-wrapper {
    margin: 15px 0;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    min-height: 200px;
}


    .table-wrapper table {
        width: 100%;
        border-collapse: collapse;
    }


    .table-wrapper th {
        background: #f4f7f6;
        text-align: left;
        padding: 10px;
        font-size: 12px;
    }


.table-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}


/* Buttons */

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-save {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-refresh {
    width: 100%;
    padding: 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}


/* Responsive Adjustment */

@media (max-width: 1100px) {

    .entry-form-container {
        grid-template-columns: 1fr; /* Stack table under form */
    }
}


/*Radio and Datebox in line*/

/* The main wrapper for the top row */

.header-inline-row {
    display: flex !important;
    flex-direction: row !important; /* Forces horizontal */
    align-items: center !important;
    gap: 40px; /* Space between Date and Radios */
    margin-bottom: 20px;
    width: 100%;
}


/* Fixes the Date Label and Input to stay side-by-side */

.date-section {
    display: flex !important;
    align-items: center !important;
    gap: 10px;

}


    .date-section label {
        margin: 0 !important; /* Removes the "stacking" margin */
        font-weight: bold;
        font-size: 20px;
        white-space: nowrap;
    }


    .date-section input {
        width: 150px !important;
    }


/* Fixes the Radio buttons to stay side-by-side */

/* Ensure the radio button is visible */

.radio-section input[type="radio"] {
    display: inline-block !important; /* Forces it to show */
    width: 16px !important; /* Size of the circle */
    height: 16px !important;
    cursor: pointer;
    accent-color: #2980b9; /* Changes the dot color to blue */
    margin: 0; /* Removes extra spacing */
}


/* Align the label text with the circle */

.radio-label {
    display: flex !important;
    align-items: center !important; /* Centers circle and text vertically */
    gap: 10px; /* Space between circle and text */
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/*over*/

/* --- Small and Big Textbox Pairs --- */

.dual-input {
    display: flex;
    gap: 10px;
}


.small-box {
    width: 80px !important;
    flex: none;
}

.big-box {
    flex: 1;
}


/* --- Action Buttons Toolbar --- */

.form-actions-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #ddd;
}


.btn-tool {
    display: flex;
    flex-direction: column; /* Icon above text like Windows software */
    align-items: center;
    padding: 8px 15px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    min-width: 70px;
    transition: 0.2s;
}


    .btn-tool i {
        font-size: 18px;
        margin-bottom: 5px;
    }


    .btn-tool:hover {
        background: #e8f0fe;
        border-color: var(--primary-blue);
        color: var(--primary-blue);
    }


/* Specific Button Colors */

.save i {
    color: #28a745;
}

.update i {
    color: #007bff;
}

.delete i {
    color: #dc3545;
}

.exit i {
    color: #333;
}


/* Layout Helpers */

.flex-2 {
    flex: 2;
}

.flex-1 {
    flex: 1;
}


/* --- FIX: Force 50/50 Split --- */

.grid-6-6 {
    display: grid;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px;
    align-items: start;
}


/* Responsive for Mobile */

@media (max-width: 1100px) {

    .grid-6-6 {
        grid-template-columns: 1fr !important;
    }
}


/* Allocation UI (Matching credit2.jpeg) */

.allocation-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.btn-allocation {
    background: #f8f9fa;
    border: 1px solid #1a73e8;
    color: #1a73e8;
    padding: 5px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}


.allocation-panel {
    background: #eff0f3; /* Yellow background from image */
    border: 2px solid #6280e0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}


.allocation-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}


.mini-table-container {
    max-height: 150px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
}


.back-btn {
    margin-top: 10px;
    background: #34495e;
}


/* FORCE 50/50 SPLIT */

.grid-6-6 {
    display: grid;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px;
    align-items: start;
}


/* SINGLE LINE HEADER (Date + Radio) */

.single-line-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}


.date-group {
    display: flex;
    align-items: center;
    gap: 10px;
}


.radio-group-inline {
    display: flex;
    gap: 15px;
    align-items: center;
}


/* COMBO BOX (Textbox + Dropdown) */

.combo-input {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}


    .combo-input input {
        border: none !important;
        width: 60px;
        border-right: 1px solid #ddd !important;
        border-radius: 0 !important;
    }


    .combo-input select {
        border: none !important;
        flex: 1;
        border-radius: 0 !important;
        background: white;
    }


/* TABLE RESPONSIVENESS */

.table-container-fixed {
    width: 100%;
    overflow-x: auto;
    background: white;
   
}


table {
    width: 100%;

    border-collapse: collapse;
    min-width: 400px; /* Forces scrollbar if container is too small */
}



/*button code start*/

/* --- Attractive Small Buttons --- */

.compact-action-bar {
    display: flex !important;
    flex-wrap: wrap !important; /* Allows buttons to wrap to next line */
    gap: 12px;
    margin-top: 20px;
    justify-content: center; /* Centers buttons on mobile */
    width: 100%;
}

.btn-sm {
    flex: 1 1 150px; /* Buttons grow but stay at least 150px wide */
    max-width: 200px; /* Prevents them from being too huge like in sub.jpg */
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white !important;
    transition: 0.3s;
}

.save {
    background-color: #27ae60 !important;
}

.update {
    background-color: #2980b9 !important;
}

.delete {
    background-color: #c0392b !important;
}

.cancel {
    background-color: #7f8c8d !important;
}

/* --- 3. Mobile Layout Fix (12345.jpg Sidebar Issue) --- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%; /* Completely hides the menu */
        z-index: 9999;
    }

        .sidebar.active {
            left: 0; /* Only shows when toggled */
        }

    .entry-form-container {
        display: block !important; /* Removes the side-by-side grid */
    }

    .form-main {
        width: 100% !important;
        margin-bottom: 20px;
    }
}

/* The loader style */
.loader {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #3498db;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Hide the loader by default */
.hidden {
    display: none;
}

