/* Tech Theme & Comprehensive Styles for 9jaTrust Dashboard */

/* Main background and font */
body {
    background: linear-gradient(135deg, #0f2027 0%, #2c5364 100%);
    color: #e0e7ef;
    font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(90deg, #01547c 60%, #59ffff 100%);
    color: #fff;
    box-shadow: 0 2px 16px rgba(1,84,124,0.18);
    border-bottom: 2px solid #59ffff;
}

/* Navbar */
.navbar {
    background: #1e293b;
    border-bottom: 1px solid #59ffff;
}
.navbar-brand {
    font-weight: bold;
    color: #59ffff !important;
    font-size: 1.5rem;
    letter-spacing: 2px;
}
.navbar .btn {
    margin-left: 1rem;
}

/* Sidebar */
#sidebar {
    background: linear-gradient(180deg, #01547c 0%, #59ffff 100%);
    color: #fff;
    min-height: 100vh;
    box-shadow: 2px 0 16px rgba(1,84,124,0.12);
}
.sidebar-menu {
    list-style: none;
    padding-left: 0;
    margin-top: 2rem;
}
.sidebar-menu li {
    margin-bottom: 1rem;
}
.sidebar-menu li a {
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    display: block;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background: #59ffff;
    color: #01547c;
    transform: scale(1.05);
}

/* Cards */
.card, .shadow-soft-xl {
    background: #232f3e;
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(1,84,124,0.18);
    color: #e0e7ef;
    margin-bottom: 2rem;
}
.card-body {
    padding: 2rem;
}

/* Buttons */
.btn-primary, .btn-success, .btn-danger, .btn-info {
    border-radius: 0.5rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(1,84,124,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-primary {
    background: linear-gradient(90deg, #01547c 0%, #59ffff 100%);
    border: none;
    color: #fff;
}
.btn-success {
    background: linear-gradient(90deg, #059669 0%, #59ffff 100%);
    border: none;
    color: #fff;
}
.btn-danger {
    background: linear-gradient(90deg, #dc2626 0%, #59ffff 100%);
    border: none;
    color: #fff;
}
.btn-info {
    background: linear-gradient(90deg, #2563eb 0%, #59ffff 100%);
    border: none;
    color: #fff;
}
.btn:hover {
    box-shadow: 0 4px 16px rgba(89,255,255,0.18);
    opacity: 0.92;
}

/* Badges */
.badge-primary, .badge-lg {
    background: #59ffff;
    color: #01547c;
    font-weight: bold;
    border-radius: 0.5rem;
    padding: 0.5em 1em;
    font-size: 1em;
}

/* Tables */
.table {
    background: #232f3e;
    color: #e0e7ef;
    border-radius: 0.75rem;
    overflow: hidden;
}
.table th, .table td {
    vertical-align: middle !important;
    border-color: #334155;
}
.table th {
    background: #01547c;
    color: #fff;
    font-weight: 700;
}
.table-striped tbody tr:nth-of-type(odd) {
    background: #1e293b;
}

/* Forms */
.form-control {
    background: #1e293b;
    color: #e0e7ef;
    border: 1px solid #59ffff;
    border-radius: 0.5rem;
    padding: 0.75rem;
}
.form-control:focus {
    border-color: #01547c;
    box-shadow: 0 0 0 2px #59ffff;
    background: #232f3e;
    color: #fff;
}

/* Alerts & Modals */
.alert, .modal-content {
    background: #232f3e;
    color: #e0e7ef;
    border-radius: 1rem;
    border: 1px solid #59ffff;
}

/* Misc */
.bg-gradient-to-tl {
    background: linear-gradient(90deg, #01547c 0%, #59ffff 100%);
}
.text-slate-700 {
    color: #334155 !important;
}
.text-slate-800 {
    color: #1e293b !important;
}
.rounded-2xl {
    border-radius: 1rem !important;
}
.shadow-soft-xl {
    box-shadow: 0 4px 24px rgba(1,84,124,0.12);
}

/* Loader */
.loader, .loader2 {
    background: #232f3e;
    border-radius: 50%;
    box-shadow: 0 0 24px #59ffff;
}

/* --- Enhanced Responsive Design --- */
@media (max-width: 1200px) {
    .container, .main-chart {
        max-width: 98vw;
        padding: 0 1rem;
    }
    .card-body {
        padding: 1rem;
    }
}
@media (max-width: 992px) {
    .container, .main-chart {
        max-width: 100vw;
        padding: 0 0.5rem;
    }
    .sidebar {
        width: 80vw !important;
        min-width: 180px;
        max-width: 320px;
        left: -80vw;
    }
    .sidebar.collapsed {
        left: -80vw !important;
    }
    .sidebar:not(.collapsed) {
        left: 0 !important;
    }
    .navbar, .header {
        flex-direction: column;
        padding: 1rem 0.5rem;
        font-size: 1.1rem;
    }
    .navbar-brand {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    .sidebar-toggle {
        display: block !important;
        left: 10px !important;
        top: 1rem !important;
    }
    .container {
        margin-left: 0 !important;
    }
}
@media (max-width: 768px) {
    .sidebar {
        width: 100vw !important;
        left: -100vw !important;
        min-width: 0;
        max-width: 100vw;
    }
    .sidebar.collapsed {
        left: -100vw !important;
    }
    .sidebar:not(.collapsed) {
        left: 0 !important;
    }
    .sidebar-menu {
        font-size: 1rem;
    }
    .container, .main-chart {
        padding: 0 0.5rem;
        margin-left: 0 !important;
    }
    .card, .shadow-soft-xl {
        margin-bottom: 1rem;
    }
    .card-body {
        padding: 0.8rem;
    }
    .navbar, .header {
        flex-direction: column;
        padding: 0.7rem 0.3rem;
    }
    .navbar-brand {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}
@media (max-width: 500px) {
    .container, .main-chart {
        padding: 0 0.2rem;
    }
    .card-body {
        padding: 0.5rem;
    }
    .sidebar {
        font-size: 0.98rem;
    }
    .sidebar .sidebar-header {
        font-size: 1rem;
    }
    .sidebar-menu li a {
        padding: 0.6rem 1rem;
        font-size: 0.98rem;
    }
    .btn, .btn-primary, .btn-success, .btn-danger, .btn-info, .btn-back {
        width: 200px;
        padding: 0.7rem 0;
        font-size: 1rem;
        margin: 0.2rem 0 0.2rem 0;
    }
    h2, .navbar-brand {
        font-size: 1rem;
    }
}
@media (max-width: 400px) {
    .container, .main-chart {
        padding: 0 0.05rem;
    }
    .card-body {
        padding: 0.3rem;
    }
    h2, .navbar-brand {
        font-size: 0.95rem;
    }
}

/* --- Flexbox Utility for Cards/Rows --- */
.row, .dashboard-cards, .services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}
@media (max-width: 900px) {
    .row, .dashboard-cards, .services-list {
        flex-direction: column;
        gap: 0.7rem;
    }
    .col-md-6, .col-lg-4, .col-md-4, .col-sm-4 {
        min-width: 95% !important;
        width: 100% !important;
    }
}

/* --- Hide sidebar overlay on desktop --- */
#sidebar-overlay {
    display: none !important;
}
@media (max-width: 900px) {
    #sidebar-overlay {
        display: block !important;
    }
}

/* --- Utility: Hide scrollbars on mobile for sidebar --- */
@media (max-width: 600px) {
    .sidebar {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}