/* ==========================================================================
   FC ERP - Combined Custom Theme Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Global & Base Styles
   -------------------------------------------------------------------------- */
html {
    font-size: 14px !important; /* Global font size reduction for better information density */
}

.text-right { text-align: right; }
.currency { text-align: right; }

td small {
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   DataTables Customization (Clean UI)
   -------------------------------------------------------------------------- */
table.dataTable.table-clean {
    border-collapse: collapse !important;
    margin-top: 1rem !important;
    width: 100% !important;
}
table.dataTable.table-clean > thead > tr > th {
    border-bottom: 1px solid var(--bs-border-color) !important;
    border-top: none !important;
    font-weight: 600;
    color: var(--bs-heading-color);
    padding: 1rem 0.5rem;
}
table.dataTable.table-clean > tbody > tr > td {
    border-bottom: 1px solid var(--bs-border-color) !important;
    padding: 1rem 0.5rem;
    vertical-align: middle;
}
table.dataTable.table-clean > tbody > tr:last-child > td {
    border-bottom: none !important;
}
/* Hide default DataTables elements since we build custom ones */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    display: none !important;
}

.custom-dt-search {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-right: 15px;
}
.custom-dt-search input {
    padding-left: 36px;
    border-radius: 6px;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}
.custom-dt-search input:focus {
    box-shadow: none;
    border-color: var(--bs-primary);
}
.dt-count-badge {
    font-size: 0.85rem;
    padding: 0.25em 0.6em;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-primary);
    border: 1px solid var(--bs-border-color);
    border-radius: 50rem;
}
.dt-count-text {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    margin-left: 6px;
}

/* --------------------------------------------------------------------------
   Reports (Balance Sheet, Cash Flow, GL, P&L, Trial Balance)
   -------------------------------------------------------------------------- */
/* Common Report Table Styles */
.bs-table th, .bs-table td,
.cf-table th, .cf-table td,
.gl-table th, .gl-table td,
.pl-table th, .pl-table td,
.tb-table th, .tb-table td { 
    padding: 8px; 
    border-bottom: 1px solid #dee2e6; 
}

/* Report Group Headers */
.bs-group-header, .pl-group-header { background-color: #e9ecef; font-weight: bold; }
.cf-section-header { background-color: #d1d5db; font-weight: bold; }
.gl-header-row { font-weight: bold; background-color: #f3f4f6; }
.tb-group-header { background-color: #f3f4f6; font-weight: bold; }

/* Report Type Headers */
.bs-type-header, .pl-type-header { font-weight: bold; padding-left: 20px !important; }
.cf-cat-header { background-color: #f3f4f6; padding-left: 20px !important; }

/* Report Account Rows */
.bs-account-row td:first-child, 
.pl-account-row td:first-child { padding-left: 40px !important; }
.cf-account-row td:first-child { padding-left: 40px !important; color: #3b82f6; }
.tb-account-row td:first-child { padding-left: 30px !important; }

/* Report Totals */
.bs-type-total td, .pl-type-total td { font-weight: bold; padding-left: 20px !important; }
.bs-group-total td, .pl-group-total td { font-weight: bold; font-size: 1.1em; background-color: #f8f9fa; }
.cf-cat-total { font-weight: bold; padding-left: 20px !important; }
.cf-section-total, .tb-total-row { font-weight: bold; border-top: 2px solid #000; }

/* Report Net Income */
.bs-net-income td { font-style: italic; padding-left: 20px !important; }
.pl-net-income td { font-weight: bold; font-size: 1.2em; border-top: 2px solid #000; }

/* Cashflow Summary Box */
.summary-box { text-align: center; font-size: 1.2rem; }
.summary-box .val { font-size: 1.5rem; font-weight: bold; }
.summary-box .val.positive { color: #10b981; }
.summary-box .val.negative { color: #ef4444; }

/* Common Filter Bar used across all Reports */
.filter-bar {
    background-color: #f0f4f8;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}
.filter-col {
    display: flex;
    flex-direction: column;
}
.filter-col label {
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 5px;
    font-weight: 500;
}
.filter-date-group {
    display: flex;
    gap: 10px;
    align-items: center;
}
.btn-update {
    height: 38px;
    border-radius: 20px;
    padding: 0 20px;
}

/* --------------------------------------------------------------------------
   Login Page
   -------------------------------------------------------------------------- */
.login-page-body {
    background-color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.login-container {  
    min-height: 100vh;
}
.left-col {
    background-color: #fcfcfc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.left-col img {
    max-width: 100%;
    height: auto;
}
.right-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}
.login-form-wrapper {
    max-width: 450px;
    width: 100%;
}
.login-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #2b2b2b;
    margin-bottom: 1rem;
}
.login-subtitle {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
    line-height: 1.5;
}
.input-group-custom {
    background-color: #f7f9fa;
    border-radius: 8px;
    overflow: visible;
    margin-bottom: 1.5rem;
}
.input-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    position: relative;
    margin-bottom: 0px; 
}
.input-row:first-child {
    border-bottom: 1px solid #e9ecef;
}
.input-icon {
    color: #adb5bd;
    font-size: 1.2rem;
    margin-right: 15px;
}
.input-field-wrapper {
    flex-grow: 1;
}
.input-label {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.input-row input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 0;
    color: #333;
    font-weight: 500;
    outline: none;
    box-shadow: none;
}
.input-row input:focus {
    outline: none;
}
.status-icon {
    color: #28a745;
    font-size: 1.2rem;
    margin-left: 10px;
}
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}
.forgot-link {
    color: #adb5bd;
    text-decoration: none;
}
.forgot-link:hover {
    color: #6c757d;
}
.btn-login {
    background-color: #3f8cff;
    color: white;
    border-radius: 50px;
    padding: 0.75rem 2.5rem;
    font-weight: 500;
    border: none;
    box-shadow: 0 4px 10px rgba(63, 140, 255, 0.3);
    transition: all 0.3s ease;
}
.btn-login:hover {
    background-color: #2974e5;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(63, 140, 255, 0.4);
}
.form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}
.validation-summary-errors {
    color: #dc3545;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 10px;
    background: #fff3f3;
    border-radius: 6px;
}
.validation-summary-errors ul {
    margin: 0;
    padding-left: 1rem;
}
.field-validation-error {
    color: #dc3545;
    font-size: 0.8rem;
    position: absolute;
    bottom: -20px;
    left: 45px;
}

/* --------------------------------------------------------------------------
   Chart of Accounts
   -------------------------------------------------------------------------- */
.coa-tabs-container {
    background-color: var(--bs-secondary-bg, rgba(13, 110, 253, 0.1));
    border-radius: 50rem;
    padding: 6px;
    display: inline-flex;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}
.coa-tab {
    border-radius: 50rem !important;
    color: inherit !important;
    padding: 8px 24px !important;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
}
.coa-tab.active {
    background-color: var(--bs-body-bg, #ffffff) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 600;
}
.coa-badge {
    border: 1px solid #0d6efd;
    color: #0d6efd;
    border-radius: 50rem;
    padding: 2px 8px;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: 600;
}
.coa-type-header {
    background-color: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.05));
    padding: 10px 16px;
    font-weight: 700;
    color: inherit;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}
.coa-type-header .bi-question-circle {
    color: var(--bs-secondary-color, #6c757d);
    margin-left: 8px;
    font-size: 0.9rem;
}
.coa-account-row {
    padding: 16px;
    border-bottom: 1px solid var(--bs-border-color, #e9ecef);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.coa-account-name {
    font-weight: 500;
    margin-bottom: 2px;
    color: inherit;
}
.coa-account-desc {
    font-size: 0.85rem;
    color: var(--bs-secondary-color, #6c757d);
}
.coa-add-link {
    padding: 16px;
    display: inline-flex;
    align-items: center;
    color: #0d6efd;
    font-weight: 600;
    text-decoration: none;
}
.coa-add-link:hover { text-decoration: underline; }
.coa-add-link i { margin-right: 8px; font-size: 1.2rem; }
.coa-edit-icon { color: #0d6efd; font-size: 1.1rem; }

/* --------------------------------------------------------------------------
   Customer Services
   -------------------------------------------------------------------------- */
.table-condensed-font { font-size: 0.85rem; }
.table-condensed-font th, .table-condensed-font td { 
    padding: 0.5rem; 
    vertical-align: middle; 
    white-space: nowrap; 
}
.wrap-header {
    white-space: normal !important;
    text-align: center;
    width: 80px !important;
    min-width: 80px;
    max-width: 80px;
}
/* Freeze the first visible column (Domain Name) */
#customerServicesTable th:nth-child(1),
#customerServicesTable td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: inset -1px 0 0 #dee2e6; /* right border */
}
#customerServicesTable thead th:nth-child(1) {
    z-index: 2;
}

/* --------------------------------------------------------------------------
   Invoice Preview
   -------------------------------------------------------------------------- */
