/**
 * SpectraTaxPro — Global application styles
 * Typography: Open Sans, sans-serif
 * Layout rules adapted from html/includes/header.php (previous project)
 */

:root {
    --font-family-base: 'Open Sans', sans-serif;
    --bs-font-sans-serif: 'Open Sans', sans-serif;
    --table-border-color: #cfd6de;
}

html,
body {
    font-family: var(--font-family-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

button,
input,
select,
textarea,
.btn {
    font-family: inherit;
}

/* ── Layout (from html/includes/header.php) ── */

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

.content-page {
    flex: 1;
    min-height: calc(100vh - 70px) !important;
}

html[data-layout-no-sidebar] .content-page,
html[data-layout-no-sidebar] .app-topbar {
    margin-left: 0;
}

.app-topbar-processing .topbar-menu {
    min-height: var(--ins-topbar-height);
}

.processing-topbar-context {
    border-left: 1px solid var(--ins-border-color, #e9ebec);
    padding-left: 0.75rem;
    min-height: 2rem;
}

.processing-topbar-heading {
    letter-spacing: 0.02em;
    color: var(--ins-body-color, #495057);
}

.processing-topbar-breadcrumb {
    font-size: 0.8125rem;
}

@media (max-width: 767.98px) {
    .processing-topbar-context {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.15rem !important;
    }

    .processing-topbar-breadcrumb {
        font-size: 0.75rem;
    }
}

.content-page.is-processing-workspace {
    height: calc(100vh - var(--ins-topbar-height, 65px)) !important;
    min-height: calc(100vh - var(--ins-topbar-height, 65px)) !important;
    max-height: calc(100vh - var(--ins-topbar-height, 65px)) !important;
    overflow: hidden;
}

.content-page.is-processing-workspace > .container-fluid {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 0.75rem;
    padding-bottom: 0;
}

body.processing-workspace-active {
    overflow: hidden;
}

/* DataTables: remove responsive white space */
.dtr-details,
tr.child {
    display: none !important;
}

.dataTables_wrapper {
    overflow: visible !important;
}

.dataTables_wrapper::after {
    display: none !important;
}

.card:has(.dataTables_wrapper) .card-body,
.dataTables_wrapper .card-body {
    min-height: auto !important;
}

/* All table headers centered */
.table thead th,
table.dataTable thead th,
table.dataTable thead td {
    text-align: center !important;
    vertical-align: middle;
}

/* S.No. column: keep header and values aligned */
table.dataTable thead th.sno-col,
table.dataTable tbody td.sno-col,
.table thead th.sno-col,
.table tbody td.sno-col,
table.dataTable thead > tr > th:first-child:not(.completed-checkbox-col):not(.import-checkbox-col),
table.dataTable tbody > tr > td:first-child:not(.completed-checkbox-cell):not(.import-checkbox-cell),
table.dataTable thead > tr > th.completed-checkbox-col + th,
table.dataTable tbody > tr > td.completed-checkbox-cell + td,
table.dataTable thead > tr > th.import-checkbox-col + th,
table.dataTable tbody > tr > td.import-checkbox-cell + td {
    text-align: center !important;
    vertical-align: middle;
    width: 60px !important;
    min-width: 60px;
    max-width: 60px;
    white-space: nowrap;
}

table.dataTable thead th.sno-col::after,
table.dataTable thead > tr > th:first-child:not(.completed-checkbox-col):not(.import-checkbox-col)::after,
table.dataTable thead > tr > th.completed-checkbox-col + th::after,
table.dataTable thead > tr > th.import-checkbox-col + th::after {
    display: none !important;
}

table.dataTable thead th.sno-col,
table.dataTable thead > tr > th:first-child:not(.completed-checkbox-col):not(.import-checkbox-col),
table.dataTable thead > tr > th.completed-checkbox-col + th,
table.dataTable thead > tr > th.import-checkbox-col + th {
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
}

/* Override Bootstrap / DataTables alignment utilities on S.No. */
table.dataTable thead th.sno-col.text-start,
table.dataTable thead th.sno-col.text-end,
table.dataTable tbody td.sno-col.text-start,
table.dataTable tbody td.sno-col.text-end,
table.dataTable thead th.sno-col.dt-type-numeric,
table.dataTable tbody td.sno-col.dt-type-numeric,
table.dataTable tbody td.sno-col.dt-body-right,
table.dataTable thead th.sno-col.dt-head-right {
    text-align: center !important;
}

/* Actions / Details columns (always last column in app tables) */
table.dataTable thead th.actions-col,
table.dataTable tbody td.actions-col,
.table thead th.actions-col,
.table tbody td.actions-col,
table.dataTable thead > tr > th:last-child,
table.dataTable tbody > tr > td:last-child {
    text-align: center !important;
    vertical-align: middle;
}

table.dataTable thead th.actions-col::after,
table.dataTable thead > tr > th:last-child::after {
    display: none !important;
}

table.dataTable thead th.actions-col.text-start,
table.dataTable thead th.actions-col.text-end,
table.dataTable tbody td.actions-col.text-start,
table.dataTable tbody td.actions-col.text-end,
table.dataTable tbody > tr > td:last-child.text-start,
table.dataTable tbody > tr > td:last-child.text-end {
    text-align: center !important;
}

table.dataTable tbody td.actions-col .d-flex,
table.dataTable tbody td.actions-col .d-inline-flex,
table.dataTable tbody > tr > td:last-child .d-flex,
table.dataTable tbody > tr > td:last-child .d-inline-flex {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center;
    vertical-align: middle;
}

/* Checkbox selection columns */
table.dataTable thead th.completed-checkbox-col,
table.dataTable tbody td.completed-checkbox-cell,
table.dataTable thead th.import-checkbox-col,
table.dataTable tbody td.import-checkbox-cell,
.table thead th.completed-checkbox-col,
.table tbody td.completed-checkbox-cell,
.table thead th.import-checkbox-col,
.table tbody td.import-checkbox-cell {
    text-align: center !important;
    vertical-align: middle !important;
    width: 42px !important;
    min-width: 42px;
    max-width: 42px;
    padding: 0.65rem 0.35rem !important;
}

table.dataTable thead th.completed-checkbox-col::after,
table.dataTable thead th.import-checkbox-col::after {
    display: none !important;
}

table.dataTable thead th.completed-checkbox-col .form-check,
table.dataTable tbody td.completed-checkbox-cell .form-check,
table.dataTable thead th.import-checkbox-col .form-check,
table.dataTable tbody td.import-checkbox-cell .form-check {
    padding-left: 0;
    min-height: 0;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

table.dataTable thead th.completed-checkbox-col .form-check-input,
table.dataTable tbody td.completed-checkbox-cell .form-check-input,
table.dataTable thead th.import-checkbox-col .form-check-input,
table.dataTable tbody td.import-checkbox-cell .form-check-input,
table.dataTable tbody td.import-checkbox-cell > .form-check-input {
    float: none;
    margin-left: 0;
    margin-top: 0;
    margin-right: 0;
}

/* Table borders in card panels */
.card-body .table,
.card-body table.dataTable {
    border: 1px solid var(--table-border-color, #cfd6de);
    border-collapse: collapse;
}

.card-body .table thead th,
.card-body .table tbody td,
.card-body .table tfoot th,
.card-body .table tfoot td,
.card-body table.dataTable thead th,
.card-body table.dataTable tbody td,
.card-body table.dataTable tfoot th,
.card-body table.dataTable tfoot td {
    border: 1px solid var(--table-border-color, #cfd6de);
}

/* Page title / breadcrumb bar (INSPINIA default, white strip) */
.page-title-head {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--ins-border-color) !important;
}

/* Sidebar brand logo */
.sidenav-menu .logo-lg img {
    height: 34px;
    width: auto;
}

.sidenav-menu .logo-sm img {
    height: 30px;
    width: auto;
}
