/* ============================================================
   BNC Admin Template — Built on Bootstrap 5
   All existing CSS class names preserved for backward compat.
   ============================================================ */

/* --- Admin Layout --- */
.admin-wrapper {
    background: #eef1f5;
}

/* --- Header --- */
.admin-header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    z-index: 1030;
}

.admin-heading {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Sidebar --- */
.admin-sidebar {
    width: 250px;
    background: #37474f;
    overflow-y: auto;
}

.sidebar-header {
    letter-spacing: 0.5px;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 10px 18px;
    font-size: 13px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.admin-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left-color: #64b5f6;
}

.admin-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-left-color: #42a5f5;
}

.admin-sidebar .nav-link i {
    font-size: 15px;
    width: 20px;
    text-align: center;
}

.offcanvas.admin-sidebar {
    width: 280px;
}

.offcanvas.admin-sidebar .offcanvas-header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

/* --- Main Content --- */
.admin-main {
    background: #f5f7fa;
    min-height: 500px;
}

/* --- Dashboard --- */
.bg-gradient-primary {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

#dashboardView .card {
    transition: transform 0.15s, box-shadow 0.15s;
}

#dashboardView .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1) !important;
}

#dashboardView .card-header {
    border-bottom: 1px solid #e0e0e0;
}

/* --- Page Content sidebar (#searchbar) --- */
#content.d-flex #searchbar {
    float: none;
    flex-shrink: 0;
}

#searchbar {
    width: 220px;
    background: #37474f;
    min-height: 500px;
}

#searchbar .nav-link.whitetxtmargin {
    color: #cfd8dc !important;
    font-size: 13px;
    padding: 8px 15px;
    text-decoration: none;
}

#searchbar .nav-link.whitetxtmargin:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
}

/* Backward compat for user controls using old sidebar classes */
.toptpaddingL, .toptpaddingA {
    padding: 8px 15px 8px 30px;
    position: relative;
}

.whitetxtmargin {
    color: #fff;
}

/* --- Headings --- */
.heading {
    color: #1a237e;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 10px;
}

/* --- Backward-compatible text classes --- */
.txtblack, .blacktxt {
    color: #333;
}

.txtblackbold {
    font-weight: 600;
    color: #333;
}

.bluetxt {
    color: #1565c0;
}

.bluetxtbold {
    font-weight: 600;
    color: #1565c0;
}

.whitetxt {
    color: #fff;
}

.txtred, .txtredb {
    color: #e53935;
    font-weight: 500;
}

.txtreds {
    color: #e53935;
    font-size: 10px;
}

.blueheadtxt {
    color: #1565c0;
    font-weight: 600;
    font-size: 14px;
}

/* --- Form elements (backward compat) --- */
.txtfield2, .txtfield3, .txtfield4, .txtlong {
    border: 1px solid #c0c0c0;
    padding: 6px 10px;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.txtfield2:focus, .txtfield3:focus, .txtfield4:focus, .txtlong:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

.txtfield1 {
    border: 1px solid #e53935;
    padding: 6px 10px;
    border-radius: 4px;
    background: #fff;
    outline: none;
}

/* Legacy button styling */
.Search, .search {
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.Search:hover, .search:hover {
    background: #0d47a1;
}

/* Table form (label+field rows) */
.table-form td:first-child {
    font-weight: 600;
    vertical-align: middle;
}

.table-form td:last-child {
    vertical-align: middle;
}

/* GridView */
.GridView {
    background: #fff;
    border-collapse: collapse;
}

.GridView th {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #37474f;
    padding: 10px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.GridView td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.GridView tr:nth-child(even) td {
    background: #f9f9f9;
}

.GridView tr:hover td {
    background: #e3f2fd;
}

.GridView a {
    color: #1565c0;
}

/* Override inline grid scroll styles */
div[style*="overflow: scroll"] {
    overflow: auto !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    background-color: #fff !important;
}

/* Message notification */
#dvMsg, div[id$="dvMsg"] {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
    border-left: 4px solid #1565c0;
    background: #e3f2fd;
}

/* Internal page container */
#internal-page {
    padding: 0;
}

#internal-page > table {
    height: auto !important;
    width: 100% !important;
}

/* Table bordered (backward compat) */
.tableboder {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.tableboder td {
    padding: 8px 12px;
}

/* Legacy container (login pages no longer use this) */
#container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    overflow: hidden;
}

/* Loading overlay */
.loading {
    font-size: 13px;
    border: none;
    border-radius: 6px;
    width: 200px;
    padding: 20px;
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-align: center;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

.display {
    display: none !important;
}

.red {
    color: #e53935;
}

.file-item {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 992px) {
    #searchbar {
        width: 100%;
        min-height: auto;
    }
    #content.d-flex {
        flex-direction: column;
    }
    .admin-main {
        padding: 12px !important;
    }
}

@media (max-width: 768px) {
    .GridView {
        font-size: 12px;
    }
    .GridView th,
    .GridView td {
        padding: 6px 4px;
    }
    .admin-heading {
        font-size: 12px;
    }
}
