/* ===== SPX Tools Global Theme ===== */

@font-face {
    font-family: 'Segoe UI';
    src: url('./segoeuithis.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Segoe UI Bold';
    src: url('./segoeuithibd.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --spx-primary: #1E2A38;
    --spx-accent: #1AA4A0;
    --spx-bg: #aaa;
    --spx-text: #2D2D2D;
    --spx-muted: #6c757d;
    --spx-border: #E0E6EC;
    --spx-debit: #D32F2F;
    --spx-credit: #2E7D32;
    --spx-warning: #FF9800;
    --spx-font: 'Segoe UI', 'Helvetica Neue', sans-serif;
    --spx-mono: 'Courier New', monospace;
}

/* === Base Reset === */
body {
    font-family: 'Segoe UI';
    background-color: var(--spx-bg) !important;
    color: var(--spx-text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow: hidden;
}

.btn {
    border-radius: 0;
}

/* === Layout Utility === */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 2rem;
}

/* === Buttons === */
.btn-primary {
    background-color: var(--spx-primary);
    border-color: var(--spx-primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: #263648;
}

.btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

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

.btn-accent:hover {
    background-color: #168b89;
}

.btn-toolbar {
    background-color: #c2c2c2;
    color: var(--bs-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 0.125rem;
    border: none;
    margin: 0;
    font-size: 1.25rem;
    transition: 0.125s ease-in-out all;
}

.btn-toolbar:hover {
    background-color: #b2b2b2;
    font-size: 1.35rem;
    transition: 0.125s ease-in-out all;
}

.btn-toolbar:disabled {
    background-color: transparent;
    color: #888;
    border: none;
}

/* === Forms === */
input,
select,
textarea {
    border: 1px solid var(--spx-border);
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 0.95rem;
    background-color: #fff;
    width: 100%;
}


/* === Toolbar === */

.toolbar-wrapper {

    overflow-y: hidden;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.toolbar {
    display: flex;
    gap: 0.125rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: start;
    padding: 0.25rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 0 4px rgba(0, 0, 0, 1);
    max-width: 100vw;
    width: 100vw;
}

.dropdown {
    position: relative;
    /* ✅ ensure dropdown-menu is positioned relative to this */
}

.dropdown-menu {
    z-index: 9999999999;
    position: absolute;
    /* ✅ needed for overlay */
    top: 100%;
    left: 0;
    transform: translateY(0.25rem);
    /* subtle offset */
}

.statubar {
    bottom: 0;
    left: 0;
    right: 0;
    margin-top: auto;
    background-color: var(--spx-primary);
    color: var(--spx-bg);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    z-index: 1000;
}

#example-table,
.tabulator {
    z-index: 1 !important;
    overflow: scroll;
}

.tabulator .tabulator-header-contents {
    font-family: 'Segoe UI Bold';
    font-weight: bold;
    text-transform: uppercase;
}

.toolbar-spacer {
    padding-left: 0.5rem;
    margin-right: 0.5rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.toolbar-spacer-mini {
    padding-left: 0.25rem;
    margin-right: 0.25rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #777;
    opacity: 0;
}

.toolbar-end {
    margin-left: auto;
}

/* === Alerts & Notifications === */
.alert-warning {
    background-color: #fff3cd;
    border: 1px solid var(--spx-warning);
    padding: 0.8rem 1rem;
    border-radius: 4px;
    color: #856404;
}

/* === Totals Footer Row === */
tfoot td {
    font-weight: bold;
    background-color: #f1f1f1;
}

/* === Modals === */
.modal-content {
    border-radius: 6px;
}

.modal-header {
    background-color: var(--spx-primary);
    color: white;
}

/* === Drop Zone === */
#drop-zone {
    background-color: #f1f4f6;
    border: 2px dashed var(--spx-border);
    border-radius: 6px;
    padding: 3rem;
    text-align: center;
    color: var(--spx-muted);
    transition: background 0.2s ease;
}

#drop-zone.dragover {
    background-color: #e0f7f6;
    border-color: var(--spx-accent);
}

/* === Responsive Tables === */
.table-wrapper {
    overflow-x: auto;
}

/* === Tooltip-like helper */
.helper-tip {
    font-size: 0.85rem;
    color: var(--spx-muted);
}

.negative-money {
    color: red;
}

#settings-modal {
    z-index: 9999999999 !important;
    /* Ensure settings modal is always on top */
}

.context-btns {
    display: flex;
    flex-direction: column;
}

.dropdown-toggle::after {
    display: none !important;
}

.tabulator-cell.rownum-column {
    font-family: 'Courier New', monospace;
    text-align: center;
    font-size: 14px;
    background-color: #ccc !important;
}

.tabulator-cell.rownum-currency {
    font-family: 'Courier New', monospace;
    text-align: center;
    font-weight: bold;

}

.text-positive {
    color: green;
}

.text-negative {
    color: red;
}

.text-rand {
    color: grey;
}

.bank-logo {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    margin: 0;
    border-radius: 0.25rem;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.toolbar-row {
    align-items: center;
    justify-content: center;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.25);
    border-bottom: 2px solid rgba(0, 0, 0, 0.25);
    padding: 2px;
    border-radius: 10px;
    background-color: transparent;
    transition: 0.125s ease-in-out all;
    display: flex;
}

.toolbar-row:hover {
    box-shadow: 0 2px 4px black;
    transition: 0.125s ease-in-out all;
}

.toolbar-section-name {
    transition: 0.125s ease-in-out all;
    text-align: center;
    padding: 0;
    margin: 0;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.25);
    color: rgba(0, 0, 0, 0.25);
    top: 0.2rem;
    font-size: 0.5rem;
    font-weight: bolder;
    text-transform: uppercase;
    letter-spacing: 0.15rem;
}

.toolbar-section:hover>.toolbar-section-name {
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
    color: rgba(0, 0, 0, 0.5);
    transition: 0.125s ease-in-out all;
    letter-spacing: 0.2rem;
}

.tabbar-container {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding: 0;
    margin: 0;
    top: 4rem;
}

.tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #aaa;
    padding: 0 1rem;
    border-radius: 10px 10px 0 0;
    border: 1px solid rgba(0,0,0,0.25   );
    border-bottom: none;
    cursor: pointer;
    user-select: none;
    opacity: 0.5;
    font-size: 1rem;
    text-align: left;
    transition: 0.125s ease-in-out all;
}

.tab-label {
    margin-right: 2rem;
}

.tab:hover {
    opacity: 0.75;
    transition: 0.125s ease-in-out all;
}

.tab.active {
    background: #ffffff;
    box-shadow: 0 0 20px black;
    opacity: 1;
}

.tab input {
    border: none;
    background: transparent;
    width: 100px;
    font-weight: bold;
}

.tab .close-btn {
    margin-left: auto;
    color: #888;
    cursor: pointer;
}

.tab .close-btn:hover {
    margin-left: auto;
    color: red;
    cursor: pointer;
    transition: 0.125s ease-in-out all;
}

.tab-rename {
    width: fit-content;
    max-width: 100%;
    min-width: 100px;
    border: 1px solid #aaa;
    background: #fff;
    padding: 2px;
    font-size: 1rem;
}

.tab.drag-over {
    border-right: 0.5rem solid var(--spx-primary);
}

.editable-tab {
    display: inline-block;
    min-width: 100px;
    padding: 2px;
    background: #fff;
    font-size: 1rem;
    white-space: nowrap;
    outline: none;
}

.editable-tab:focus {
    border-color: #777;
    background: #fff;
}
