:root {
    --primary-color: #0056b3;
    /* Primary Blue */
    --primary-color-hover: #004494;
    --sidebar-bg: #ffffff;
    --sidebar-item-active: rgba(0, 86, 179, 0.1);
    /* Blue tint active */
    --bg-main: #f4f6f8;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-secondary: #0056b3;
    /* Blue Text for Menu Items */
    --border-color: #e1e4e8;
    --table-header-bg: #f8f9fa;
    --input-bg: #ffffff;
}



* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color .3s, color .3s;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #003d80;
    /* Darker Blue for Sidebar Headers */
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 1000;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
    font-size: 16px;
    color: #003d80;
    /* Dark Blue Logo Text */
}

.logo-shield {
    color: var(--primary-color);
    font-size: 20px;
    transition: filter 0.3s ease;
}

body.dark-mode .logo-shield {
    /* Invert colors to make dark logo visible on dark background */
    filter: invert(1) brightness(1.5);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.menu-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #0056b3;
    /* Blue Labels */
    padding: 15px 20px 5px;
    letter-spacing: 0.5px;
}

.menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #0056b3;
    /* Blue Menu Items */
    text-decoration: none;
    font-size: 14px;
    transition: all .2s;
    font-weight: 500;
}

.menu-item i {
    width: 20px;
    text-align: center;
}

.menu-item.active {
    background-color: var(--sidebar-item-active);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.menu-item:hover {
    background-color: rgba(255, 158, 128, 0.1);
    /* Peach tint */
    color: #ff9e80 !important;
    border-right: 3px solid #ff9e80;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumb h2 {
    font-size: 22px;
    font-weight: 700;
}

.breadcrumb p {
    color: var(--text-secondary);
    font-size: 13px;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

.plan-badge {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
    text-align: right;
}

.plan-badge span {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: block;
}

.theme-toggle {
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all .2s;
}

.theme-toggle:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    position: relative;
    transition: transform 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Themed Gradients */
.card-gradient-teal {
    background-image: linear-gradient(135deg, #11998e, #38ef7d) !important;
    background-color: transparent !important;
    color: #fff;
    border: none;
}

.card-gradient-orange {
    background-image: linear-gradient(135deg, #fc4a1a, #f7b733) !important;
    background-color: transparent !important;
    color: #fff;
    border: none;
}

.card-gradient-red {
    background-image: linear-gradient(135deg, #cb2d3e, #ef473a) !important;
    background-color: transparent !important;
    color: #fff;
    border: none;
}

.card-gradient-purple {
    background-image: linear-gradient(135deg, #8e2de2, #4a00e0) !important;
    background-color: transparent !important;
    color: #fff;
    border: none;
}

.card-gradient-blue {
    background-image: linear-gradient(135deg, #2193b0, #6dd5ed) !important;
    background-color: transparent !important;
    color: #fff;
    border: none;
}

.card-gradient-dark {
    background-image: linear-gradient(135deg, #232526, #414345) !important;
    background-color: transparent !important;
    color: #fff;
    border: none;
}

.dashboard-card[class*="card-gradient-"] .card-title i {
    color: #fff !important;
}

.dashboard-card[class*="card-gradient-"] p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.dashboard-card[class*="card-gradient-"] ul {
    color: rgba(255, 255, 255, 0.8) !important;
}

.dashboard-card[class*="card-gradient-"] ul li::marker {
    color: rgba(255, 255, 255, 0.5);
}


.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.card-title>a,
.card-title>button,
.card-title>div:last-child {
    margin-left: auto;
}

/* Search Section */
.ops-search-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-field {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    outline: none;
    color: var(--text-main);
}

.btn-execute {
    background: var(--primary-color);
    color: #fff;
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.btn-execute:hover {
    background: var(--primary-color-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 86, 179, 0.2);
}

/* Tables */
.history-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.history-header {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    background: var(--table-header-bg);
    padding: 12px 25px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: .5px;
}

.history-table td {
    padding: 15px 25px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.type-pill {
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(0, 86, 179, 0.1);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 700;
}

/* Mobile Responsive */
.mobile-toggle {
    display: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-main);
    padding: 5px;
    position: relative;
    z-index: 10001 !important;
    /* Above sidebar */
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-logo span,
    .menu-item span,
    .menu-label,
    .sidebar-header div:last-child {
        display: none;
    }

    .main-wrapper {
        margin-left: 70px;
    }

    .menu-item {
        justify-content: center;
        padding: 15px 0;
    }

    .menu-item i {
        width: auto;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
        padding: 15px;
    }

    .sidebar {
        width: 260px;
        transform: translateX(-105%);
        transition: transform 0.3s ease;
        border-right: none;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        background-color: #ffffff !important;
        /* Force White Background */
        height: 100vh;
        z-index: 9999 !important;
        overflow-y: auto;
        /* Scroling */
    }

    .sidebar * {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .sidebar.active {
        transform: translateX(0) !important;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .sidebar-logo span,
    .menu-item span,
    .menu-label,
    .sidebar-header div:last-child {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .sidebar {
        z-index: 9999;
        /* Ensure on top */
    }

    .menu-item {
        justify-content: flex-start;
        padding: 12px 20px;
    }

    .menu-item i {
        width: 20px;
        font-size: 14px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Login Page Styles */
.login-body {
    justify-content: center;
    align-items: center;
    background-color: #f0f2f5;
    display: flex;
    min-height: 100vh;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    border: none;
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    margin-top: 10px;
    transition: all .2s;
}

.btn-login:hover {
    background: var(--primary-color-hover);
}

. t h e m e - t o g g l e    {
                 c u r s o r :    p o i n t e r ;
                 b a c k g r o u n d :    r g b a ( 0 ,    0 ,    0 ,    0 . 0 5 ) ;
                 p a d d i n g :    8 p x ;
                 b o r d e r - r a d i u s :    5 0 % ;
                 w i d t h :    3 5 p x ;
                 h e i g h t :    3 5 p x ;
                 d i s p l a y :    f l e x ;
                 a l i g n - i t e m s :    c e n t e r ;
                 j u s t i f y - c o n t e n t :    c e n t e r ;
                 t r a n s i t i o n :    b a c k g r o u n d   0 . 3 s ,    c o l o r   0 . 3 s ;
                 b o r d e r :    1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ;
         
}

         . t h e m e - t o g g l e : h o v e r    {
                 b a c k g r o u n d :    r g b a ( 0 ,    0 ,    0 ,    0 . 1 ) ;
         
}

         b o d y . d a r k - m o d e   . t h e m e - t o g g l e    {
                 b a c k g r o u n d :    r g b a ( 2 5 5 ,    2 5 5 ,    2 5 5 ,    0 . 1 ) ;
                 c o l o r :    # f f d 7 0 0 ;
                 / *   G o l d   s u n   * /             b o r d e r - c o l o r :    r g b a ( 2 5 5 ,    2 5 5 ,    2 5 5 ,    0 . 2 ) ;
         
}

         b o d y . d a r k - m o d e   . t h e m e - t o g g l e : h o v e r    {
                 b a c k g r o u n d :    r g b a ( 2 5 5 ,    2 5 5 ,    2 5 5 ,    0 . 2 ) ;
         
}

      .dashboard-gradient {
    background: linear-gradient(135deg, #F6A04D 0%, #FFF6EB 50%, #7BC96F 100%) !important;
    background-attachment: fixed !important;
}

/* Simple Internal Scrolling for Results */
.results-scroll-box {
    width: 100%;
    max-height: 75vh;
    /* Fixed height to trigger scroll */
    overflow-y: auto !important;
    /* Force scrollbar */
    overflow-x: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: block;
    scrollbar-width: thin;
}

/* Webkit Scrollbar */
.results-scroll-box::-webkit-scrollbar {
    width: 8px;
}

.results-scroll-box::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.results-scroll-box::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.results-scroll-box::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.results-scroll-box table {
    width: 100%;
    margin-bottom: 0;
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .results-scroll-box {
        max-height: 60vh;
    }
}