/* EagleAsset full-site modernisation layer.
   This file adapts the existing Bootstrap-era page markup to the RedesignStarter shell
   without touching PHP CRUD, AJAX endpoints, classes, or MySQL logic. */

body {
    background: #f4f7fb;
}

.ea-app-shell {
    min-height: 100vh;
}

.ea-content {
    min-height: calc(100vh - var(--topbar-h));
    padding: 16px;
}

.ea-page-head {
    margin: 0 0 16px;
}

.ea-page-head h1 {
    font-size: 22px;
}

.navbar-spacer,
.main-space,
.color-line,
body > .color-line,
body > .navbar-spacer {
    display: none !important;
}

.container,
.container-fluid,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.top-margin {
    margin-top: 0 !important;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 12px;
}

[class^="col-"],
[class*=" col-"] {
    min-width: 0;
}

.col,
.col-12,
.col-md-12,
.col-lg-12 {
    flex: 1 1 100%;
}

.col-6,
.col-md-6,
.col-lg-6 {
    flex: 1 1 calc(50% - 12px);
}

.col-4,
.col-md-4,
.col-lg-4 {
    flex: 1 1 calc(33.333% - 12px);
}

.col-3,
.col-md-3,
.col-lg-3 {
    flex: 1 1 calc(25% - 12px);
}

.card,
.panel,
.modal-content,
.login,
#myForm,
#myDetails:has(*) {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.card-header,
.panel-heading,
.modal-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    color: var(--titled);
    font-weight: 800;
}

.card-body,
.panel-body,
.modal-body,
.login,
#myForm,
#myDetails:has(*) {
    padding: 14px;
}

.table,
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    color: var(--text);
}

table th,
.table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fbff;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .02em;
    font-weight: 900;
}

table th,
table td,
.table th,
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table tr:hover td,
.table tr:hover td {
    background: #fbfdff;
}

.table-responsive,
.dataTables_wrapper,
.table-lite-wrapper {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.dataTables_filter,
.dataTables_length,
.dt-buttons,
.table-lite-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
}

.dataTables_filter input,
.table-lite-search,
.form-control,
.form-select,
select,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea {
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 7px 10px;
    background: #fff;
    color: var(--text);
    outline: none;
}

.form-control:focus,
.form-select:focus,
select:focus,
input:focus,
textarea:focus {
    border-color: var(--borderfocus);
    box-shadow: var(--focus);
}

.btn,
button,
input[type="button"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    filter: brightness(.97);
}

.btn-light,
.btn-secondary {
    background: #fff;
    color: var(--primary);
    border-color: var(--border);
}

.btn-green,
.btn-success,
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-red,
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.pull-right,
.float-end,
.text-end {
    margin-left: auto;
    text-align: right;
}

.text-center {
    text-align: center;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.log-in-form {
    max-width: 430px;
    min-height: 100vh;
    display: grid;
    align-content: center;
    gap: 14px;
    padding: 24px !important;
}

body:has(.log-in-form) {
    background: radial-gradient(circle at top left, rgba(66, 189, 203, .18), transparent 30%), #f4f7fb;
}

.log-in-form > img {
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    min-width: 220px;
    z-index: 1000;
    padding: 8px;
    margin: 6px 0 0;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

.dropdown.open > .dropdown-menu,
.dropdown:hover > .dropdown-menu,
.dropdown-menu.show {
    display: block;
}

.dropdown-menu a,
.dropdown-item {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
}

.dropdown-menu a:hover,
.dropdown-item:hover {
    background: #f4f7fb;
}

.ea-sidebar .dropdown-menu {
    position: static;
    box-shadow: none;
    margin: 4px 0 8px 34px;
    min-width: 0;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    overflow: auto;
    padding: 32px 16px;
    background: rgba(15, 23, 42, .45);
}

.modal.show {
    display: block;
}

.modal-dialog {
    width: min(920px, 96vw);
    margin: 0 auto;
}

.modal-dialog.modal-lg {
    width: min(1100px, 96vw);
}

.modal-dialog.modal-sm {
    width: min(520px, 96vw);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}

.btn-close {
    min-width: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    background: #f4f7fb;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-close::before {
    content: '×';
    font-size: 20px;
    line-height: 1;
}

.offcanvas {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: min(440px, 92vw);
    height: 100vh;
    z-index: 1060;
    background: #fff;
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: auto;
}

.offcanvas.show {
    display: block;
}

.offcanvas-header,
.offcanvas-body {
    padding: 16px;
}

.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.ea-topbar-actions a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 10px;
    color: #fff;
}

.ea-topbar-actions .dropdown-menu a {
    color: var(--text);
}

.ea-menu-icon i {
    font-size: 12px;
}

.alert,
.badge {
    border-radius: 999px;
    padding: 6px 10px;
}

@media (max-width: 900px) {
    .ea-content {
        padding: 10px;
    }

    .col-6,
    .col-md-6,
    .col-lg-6,
    .col-4,
    .col-md-4,
    .col-lg-4,
    .col-3,
    .col-md-3,
    .col-lg-3 {
        flex-basis: 100%;
    }
}
