/* ePay — Site-specific styles (complement business-central-theme.css) */

/* Dashboard cards */
.dashboard-card {
    border-left: 4px solid var(--bc-accent);
    transition: box-shadow 0.2s;
}

.dashboard-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-card .card-title {
    font-size: 0.85rem;
    color: var(--bc-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-card .card-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--bc-text);
}

/* Tab styles for edit forms */
.nav-tabs .nav-link {
    color: var(--bc-text);
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--bc-accent);
    border-bottom-color: var(--bc-accent);
    font-weight: 600;
}

/* Action toolbar (top of list pages) */
.action-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--bc-border, #dee2e6);
}

/* Sticky table headers */
.table thead.sticky-top th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
}

/* Modal forms - compact spacing */
.modal-body .form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.modal-body .form-check-label {
    font-size: 0.8125rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Status badges */
.badge-active {
    background-color: var(--bc-success);
    color: white;
}

.badge-inactive {
    background-color: var(--bc-danger);
    color: white;
}


/* ═══════════════════════════════════════════════════════
   Employee Edit Form — BC FastTab Design
   Sticky header bar + tabbed card + collapsible sections
   ═══════════════════════════════════════════════════════ */

/* ── Employee Photo (Small circle in header bar) ── */
.emp-photo-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2rem;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--bc-border);
}

.emp-photo-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Employee Photo Upload (Tab 1) ── */
.emp-photo-upload {
    width: 100px;
    flex-shrink: 0;
}

.emp-photo-preview {
    width: 90px;
    height: 110px;
    border: 2px dashed #ced4da;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 3rem;
    background: #f8f9fa;
    overflow: hidden;
    margin: 0 auto;
}

.emp-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Searchable Select Dropdown ── */
.ss-wrapper {
    position: relative;
}

.ss-display {
    cursor: text;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px 9px;
    padding-right: 24px !important;
}

.ss-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bc-white);
    border: 1px solid var(--bc-accent);
    border-top: none;
    z-index: 1055;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    border-radius: 0 0 4px 4px;
}

.ss-item {
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.8rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.ss-item:last-child {
    border-bottom: none;
}

.ss-item:hover {
    background: #e7f3ff;
}

.ss-item.ss-highlighted {
    background: var(--bc-accent);
    color: white;
}

/* ── Bottom Action Bar (Close / Save / Next) ── */
.emp-bottom-bar {
    padding: 8px 16px;
    background: var(--bc-white);
    border: 1px solid var(--bc-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.04);
    margin-top: 0;
}

/* ── Sticky Header Bar ── */
.emp-header-bar {
    padding: 10px 16px;
    background: var(--bc-white);
    border: 1px solid var(--bc-border);
    border-radius: 6px 6px 0 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.emp-hdr-group {
    display: flex;
    flex-direction: column;
}

.emp-hdr-lbl {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--bc-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    line-height: 1;
    white-space: nowrap;
}

/* ── Tab Navigation (below header, above card) ── */
.emp-tabs {
    background: var(--bc-white);
    border: 1px solid var(--bc-border);
    border-top: none;
    border-bottom: 2px solid var(--bc-border);
    padding: 0 12px;
    margin-bottom: 0;
}

.emp-tabs .nav-link {
    font-size: 0.8rem;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--bc-text-light);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    border-radius: 0;
}

.emp-tabs .nav-link:hover {
    color: var(--bc-accent);
    background: var(--bc-accent-light);
    border-bottom-color: rgba(0,120,212,0.3);
}

.emp-tabs .nav-link.active {
    color: var(--bc-accent);
    font-weight: 600;
    border-bottom-color: var(--bc-accent);
    background: var(--bc-white);
}

.emp-tabs .nav-link i {
    font-size: 0.9rem;
}

.tab-kbd {
    font-size: 0.58rem;
    padding: 1px 4px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 3px;
    color: #868e96;
    font-family: 'Segoe UI', monospace;
    line-height: 1.3;
    margin-left: 3px;
    vertical-align: 1px;
}

.nav-link.active .tab-kbd {
    background: rgba(0,120,212,0.1);
    border-color: rgba(0,120,212,0.25);
    color: var(--bc-accent);
}


/* ═══════════════════════════════════════
   FastTab — BC-style collapsible sections
   ═══════════════════════════════════════ */

.fasttab {
    border-bottom: 1px solid #eee;
}

.fasttab:last-child {
    border-bottom: none;
}

.fasttab-hdr {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bc-text);
    padding: 8px 16px;
    background: linear-gradient(to bottom, #f8f9fa, #f1f3f5);
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
    user-select: none;
}

.fasttab-hdr i {
    color: var(--bc-accent);
    font-size: 0.85rem;
}

.fasttab-collapse {
    cursor: pointer;
}

.fasttab-collapse:hover {
    background: linear-gradient(to bottom, #edf0f3, #e5e9ed);
}

.fasttab-chevron {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    color: #6c757d;
}

.fasttab-collapse[aria-expanded="false"] .fasttab-chevron {
    transform: rotate(-90deg);
}

.ctc-summary-bar .badge {
    font-size: 0.72rem;
    padding: 3px 8px;
    font-weight: 600;
}

.fasttab-body {
    padding: 10px 16px 12px;
    background: var(--bc-white);
}


/* ── FastTab Form Labels ── */
.ft-lbl {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--bc-text-light);
    margin-bottom: 2px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ft-lbl .text-danger {
    font-weight: 700;
}


/* ── Compact Form Controls (inside FastTabs) ── */
.fasttab-body .form-control-sm,
.fasttab-body .form-select-sm {
    font-size: 0.8rem;
    padding: 4px 8px;
    height: auto;
    line-height: 1.4;
    border-radius: 4px;
}

.fasttab-body textarea.form-control-sm {
    min-height: 36px;
    resize: vertical;
}

/* Tighter row gaps */
.fasttab-body .row.g-2 > [class*="col-"] {
    margin-bottom: 2px;
}


/* ── Focus States ── */
.fasttab-body .form-control:focus,
.fasttab-body .form-select:focus {
    border-color: var(--bc-accent);
    box-shadow: 0 0 0 2px rgba(0,120,212,0.1);
}

/* Required field left-border indicator */
.fasttab-body .form-control:required:invalid {
    border-left: 3px solid var(--bc-danger);
}

.fasttab-body .form-control:required:valid,
.fasttab-body .form-select:required:valid {
    border-left: 3px solid var(--bc-success);
}


/* ── Salary / Data Tables ── */
.sal-table {
    font-size: 0.8rem;
}

.sal-table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 6px 8px;
    background: #f1f3f5;
    border-bottom: 2px solid var(--bc-border);
    white-space: nowrap;
    color: var(--bc-text-light);
}

.sal-table td {
    padding: 4px 8px;
    vertical-align: middle;
}

.sal-table .form-control-sm {
    font-size: 0.78rem;
    padding: 2px 6px;
}

.sal-table .badge {
    font-size: 0.65rem;
    padding: 2px 6px;
}


/* ── Compact Checkboxes ── */
.fasttab-body .form-check-input {
    width: 15px;
    height: 15px;
    margin-top: 2px;
}

.fasttab-body .form-check-label {
    font-size: 0.78rem;
    padding-top: 1px;
}


/* ── Salary Totals ── */
#tfootSalary td {
    font-size: 0.82rem;
    padding: 6px 8px;
}


/* ═══════════════════════
   Legacy: Compact labels
   (for other master forms)
   ═══════════════════════ */

.cmp-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 2px;
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bc-accent);
    padding: 4px 0 3px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(0,120,212,0.15);
}

.cmp-table {
    font-size: 0.8rem;
}

.cmp-table th {
    font-size: 0.75rem;
    padding: 4px 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    background: #f1f3f5;
    border-bottom: 2px solid var(--bc-border);
}

.cmp-table td {
    padding: 3px 6px;
    vertical-align: middle;
}


/* ═══════════════════
   Print & Responsive
   ═══════════════════ */

@media print {
    .epay-topbar,
    .epay-sidebar,
    .action-toolbar,
    .no-print {
        display: none !important;
    }

    .epay-content {
        margin-left: 0 !important;
    }

    body {
        background: white;
        overflow: visible;
    }

    .emp-header-bar {
        position: static;
        box-shadow: none;
    }

    .fasttab-hdr {
        background: #f8f9fa;
    }
}

@media (max-width: 992px) {
    .emp-header-bar {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .emp-hdr-group {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .emp-tabs .nav-link {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .tab-kbd {
        display: none;
    }

    .fasttab-body {
        padding: 8px 10px;
    }
}


/* ═══════════════════════════════════════════════
   EmpSearch — Employee Autocomplete Component
   Replaces raw Employee ID number inputs with
   searchable Code/Name typeahead across all pages.
   ═══════════════════════════════════════════════ */

.emp-search-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}

.emp-search-wrap input[type="text"] {
    padding-right: 24px;
}

.emp-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    font-size: 1.1rem;
    line-height: 1;
    z-index: 2;
    display: none;
    user-select: none;
}

.emp-search-clear:hover {
    color: var(--bc-danger, #dc3545);
}

.emp-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--bc-accent, #0078d4);
    border-top: none;
    z-index: 1055;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 4px 4px;
}

.emp-search-item {
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.82rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emp-search-item:last-child {
    border-bottom: none;
}

.emp-search-item:hover {
    background: #e7f3ff;
}

.emp-search-item.emp-search-active {
    background: var(--bc-accent, #0078d4);
    color: #fff;
}

.emp-search-item.emp-search-active .emp-search-code,
.emp-search-item.emp-search-active .emp-search-name {
    color: #fff;
}

.emp-search-code {
    font-weight: 600;
    color: var(--bc-accent, #0078d4);
    margin-right: 6px;
    font-size: 0.8rem;
}

.emp-search-name {
    color: var(--bc-text, #333);
    font-size: 0.8rem;
}

.emp-search-all {
    font-weight: 600;
    color: var(--bc-text-light, #6c757d);
    font-style: italic;
}

.emp-search-no-result {
    color: #999;
    font-style: italic;
    cursor: default;
}

.emp-search-no-result:hover {
    background: transparent;
}
