/* DistinctPayroll — unified brand theme (#e31f24) */

body {
    background-color: var(--dp-bg, #f7fafc);
}

:root {
    --dp-primary: #e31f24;
    --dp-primary-hover: #c4191e;
    --dp-primary-dark: #a31519;
    --dp-primary-light: #fde9ea;
    --dp-primary-rgb: 227, 31, 36;
    --dp-text: #2c3e50;
    --dp-text-muted: #64748b;
    --dp-border: #e7e7e7;
    --dp-bg: #f7fafc;
    --dp-surface: #ffffff;
    --dp-sidebar-bg: #ffffff;
    --dp-sidebar-nav: #f8fafc;
    --dp-input-height: 38px;

    --bs-primary: var(--dp-primary);
    --bs-primary-rgb: var(--dp-primary-rgb);
    --bs-link-color: var(--dp-primary);
    --bs-link-hover-color: var(--dp-primary-hover);
}

/* —— Buttons —— */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--dp-primary);
    --bs-btn-border-color: var(--dp-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--dp-primary-hover);
    --bs-btn-hover-border-color: var(--dp-primary-hover);
    --bs-btn-active-bg: var(--dp-primary-dark);
    --bs-btn-active-border-color: var(--dp-primary-dark);
    --bs-btn-focus-shadow-rgb: var(--dp-primary-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--dp-primary);
    --bs-btn-border-color: var(--dp-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--dp-primary);
    --bs-btn-hover-border-color: var(--dp-primary);
    --bs-btn-active-bg: var(--dp-primary-hover);
    --bs-btn-active-border-color: var(--dp-primary-hover);
}

.btn-danger {
    --bs-btn-bg: var(--dp-primary);
    --bs-btn-border-color: var(--dp-primary);
    --bs-btn-hover-bg: var(--dp-primary-hover);
    --bs-btn-hover-border-color: var(--dp-primary-hover);
}

.dp-btn-add {
    border-radius: 10px !important;
    background: linear-gradient(135deg, var(--dp-primary) 0%, var(--dp-primary-hover) 100%) !important;
    border: none !important;
    padding: 0 14px !important;
    min-width: 40px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(var(--dp-primary-rgb), 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dp-btn-add i {
    font-size: 13px;
    line-height: 1;
}

.dp-btn-add:hover {
    background: linear-gradient(135deg, var(--dp-primary-hover) 0%, var(--dp-primary-dark) 100%) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--dp-primary-rgb), 0.38);
}

.dp-btn-add:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(var(--dp-primary-rgb), 0.28);
}

.dp-btn-action {
    border-radius: 10px !important;
    border: 1px solid var(--dp-border) !important;
    background: var(--dp-surface) !important;
    color: var(--dp-text) !important;
    font-size: 14px !important;
    padding: 5px 10px 5px 15px !important;
    height: 40px !important;
}

.dp-btn-action:hover {
    border-color: var(--dp-primary) !important;
    color: var(--dp-primary) !important;
}

/* —— Syncfusion grid & pager —— */
.dashboard__table .dashboard__tableBodyTable .e-grid {
    border: 1px solid var(--dp-border) !important;
    border-radius: 8px;
    overflow: hidden;
    background: var(--dp-surface);
}

.dashboard__table .e-grid .e-gridheader,
.dashboard__table .e-grid .e-gridcontent,
.dashboard__table .e-grid .e-headercell,
.dashboard__table .e-grid .e-rowcell,
.dashboard__table .e-grid .e-filterbarcell,
.dashboard__table .e-grid .e-summarycell {
    border-color: var(--dp-border) !important;
}

.dashboard__table .e-grid .e-gridheader {
    border-bottom: 1px solid var(--dp-border);
}

.dashboard__table .e-grid .e-toolbar {
    border-bottom: 1px solid var(--dp-border);
}

.dashboard__table .e-grid .e-gridpager {
    border-top: 1px solid var(--dp-border);
    background: var(--dp-surface);
}

.e-grid .e-gridheader,
.e-grid .e-headercell {
    background-color: #fafbfc !important;
    color: var(--dp-text) !important;
}

.dashboard__table .e-grid.e-bothlines .e-headercell,
.dashboard__table .e-grid.e-bothlines .e-rowcell {
    border-style: solid;
}

.dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell:not(.e-active) {
    background-color: #fafbfc;
}

.dashboard__table .e-grid .e-row:hover .e-rowcell:not(.e-active) {
    background-color: var(--dp-primary-light);
}

/* Grid cell click/focus: no red bar or tinted background */
.e-grid .e-rowcell.e-active,
.e-grid .e-rowcell.e-focused,
.e-grid .e-rowcell.e-focus,
.e-grid .e-focused.e-rowcell:not(.e-menu-item):not(.e-editedbatchcell),
.e-grid .e-row.e-focus .e-rowcell,
.e-grid .e-rowcell.e-cellselectionbackground,
.e-grid .e-rowcell.e-selectionbackground {
    box-shadow: none !important;
    background-color: inherit !important;
    color: inherit !important;
}

.dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell.e-active,
.dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell.e-focused,
.dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell.e-focus,
.dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell.e-cellselectionbackground,
.dashboard__table .e-grid .e-row:nth-child(even) .e-rowcell.e-selectionbackground {
    background-color: #fafbfc !important;
}

.dashboard__table .e-grid .e-row:hover .e-rowcell.e-active,
.dashboard__table .e-grid .e-row:hover .e-rowcell.e-focused,
.dashboard__table .e-grid .e-row:hover .e-rowcell.e-focus {
    background-color: #f3f4f6 !important;
}

.e-pager .e-currentitem,
.e-pager .e-numericitem.e-currentitem.e-active,
.e-pager .e-numericitem.e-currentitem {
    background: var(--dp-primary) !important;
    color: #fff !important;
    border-color: var(--dp-primary) !important;
}

.e-pager .e-numericitem:hover,
.e-pager .e-link.e-numericitem:hover {
    background: var(--dp-primary-light) !important;
    color: var(--dp-primary) !important;
}

.e-input-group:not(.e-success):not(.e-warning):not(.e-error),
.e-input-group.e-control-wrapper:not(.e-success):not(.e-warning):not(.e-error) {
    border-color: var(--dp-border);
}

.e-input-group:not(.e-disabled):active:not(.e-success):not(.e-warning):not(.e-error),
.e-input-group.e-control-wrapper:not(.e-disabled):active:not(.e-success):not(.e-warning):not(.e-error),
.e-input-group:not(.e-disabled).e-input-focus:not(.e-success):not(.e-warning):not(.e-error),
.e-input-group.e-control-wrapper:not(.e-disabled).e-input-focus:not(.e-success):not(.e-warning):not(.e-error) {
    border-color: var(--dp-primary) !important;
    box-shadow: 0 0 0 1px rgba(var(--dp-primary-rgb), 0.15) !important;
}

.e-checkbox-wrapper .e-frame.e-check,
.e-css.e-checkbox-wrapper .e-frame.e-check {
    background-color: var(--dp-primary) !important;
    border-color: var(--dp-primary) !important;
}

.e-btn.e-primary,
.e-css.e-btn.e-primary {
    background-color: var(--dp-primary) !important;
    border-color: var(--dp-primary) !important;
}

.e-btn.e-primary:hover,
.e-css.e-btn.e-primary:hover {
    background-color: var(--dp-primary-hover) !important;
    border-color: var(--dp-primary-hover) !important;
}

.grid-row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

.grid-row-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 9px;
    min-height: 28px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 7px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.grid-row-action-btn i {
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}

.grid-row-action-btn:hover {
    text-decoration: none;
}

.grid-act-edit {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.grid-act-edit:hover {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}

.grid-act-disable {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.grid-act-disable:hover {
    background: #d97706;
    color: #fff;
    border-color: #d97706;
}

.grid-act-enable {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.grid-act-enable:hover {
    background: #059669;
    color: #fff;
    border-color: #059669;
}

.grid-act-delete {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.grid-act-delete:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.grid-act-view {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.grid-act-view:hover {
    background: #334155;
    color: #fff;
    border-color: #334155;
}

.grid-act-share {
    background: #f5f3ff;
    color: #6d28d9;
    border-color: #ddd6fe;
}

.grid-act-share:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.grid-act-default {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.grid-act-default:hover {
    background: #64748b;
    color: #fff;
    border-color: #64748b;
}

.dashboard__table .e-grid .e-rowcell .grid-row-actions {
    padding: 2px 0;
}

.dashboard__table .e-grid .e-rowcell .grid-row-actions .grid-row-action-btn {
    box-shadow: none;
}

/* —— Header —— */
.dashboard__header {
    border-bottom: 1px solid var(--dp-border);
    background: var(--dp-surface) !important;
}

/* —— Popup toolbar menus —— */
.dashboard .popup-sm li .btn:hover {
    background: var(--dp-primary-light) !important;
    color: var(--dp-primary) !important;
}

/* —— Forms —— */
.master-form-card .btn-primary {
    min-width: 100px;
    border-radius: 8px;
}

/* Bootstrap + Syncfusion: same height for text inputs and dropdowns */
.form-control:not(textarea):not(.form-control-sm):not(.login__control),
.form-select:not(.form-select-sm):not(.login__control) {
    height: var(--dp-input-height);
    min-height: var(--dp-input-height);
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    font-size: 12px;
    box-sizing: border-box;
}

.master-form-card .e-input-group.e-control-wrapper:not(.e-small):not(.e-multi-line-input),
.dashboard__body main form .e-input-group.e-control-wrapper:not(.e-small):not(.e-multi-line-input) {
    height: var(--dp-input-height) !important;
    min-height: var(--dp-input-height) !important;
    box-sizing: border-box;
}

.master-form-card .e-input-group:not(.e-small):not(.e-multi-line-input) input.e-input,
.master-form-card .e-input-group:not(.e-small):not(.e-multi-line-input) textarea.e-input,
.dashboard__body main form .e-input-group:not(.e-small):not(.e-multi-line-input) input.e-input,
.dashboard__body main form .e-input-group:not(.e-small):not(.e-multi-line-input) textarea.e-input {
    height: 100% !important;
    min-height: 0 !important;
    line-height: 1.5 !important;
    box-sizing: border-box;
    font-size: 12px !important;
}

.master-form-card .e-input-group .e-input-group-icon,
.dashboard__body main form .e-input-group .e-input-group-icon {
    min-height: calc(var(--dp-input-height) - 2px) !important;
    height: calc(var(--dp-input-height) - 2px) !important;
    min-width: calc(var(--dp-input-height) - 2px) !important;
    font-size: 12px !important;
}

.master-form-card .e-multi-select-wrapper,
.dashboard__body main form .e-multi-select-wrapper {
    min-height: var(--dp-input-height) !important;
}

/* Grid inline/filter editors keep Syncfusion default sizing */
.dashboard__table .e-grid .e-input-group.e-control-wrapper,
.dashboard__table .e-grid .e-input-group input.e-input,
.dashboard__table .e-grid .e-filterbarcell .e-input-group.e-control-wrapper,
.dashboard__table .e-grid .e-filterbarcell .e-input-group input.e-input {
    height: auto !important;
    min-height: unset !important;
}

/* Grid toolbar search — keep inside toolbar row, aligned with action buttons */
.dashboard__table .e-grid .e-toolbar {
    overflow: visible !important;
    min-height: 48px;
    padding: 0;
    background: var(--dp-surface);
}

.dashboard__table .e-grid .e-toolbar .e-toolbar-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    min-height: 48px;
    padding: 8px 12px;
    box-sizing: border-box;
    gap: 4px;
}

.dashboard__table .e-grid .e-toolbar .e-toolbar-left,
.dashboard__table .e-grid .e-toolbar .e-toolbar-right,
.dashboard__table .e-grid .e-toolbar .e-toolbar-center {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    align-self: center !important;
    padding: 0 0 0 8px !important;
    margin: 0 !important;
    height: auto !important;
    position: static !important;
    float: none !important;
}

.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper .e-search,
.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper .e-input-group,
.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper .e-input-group.e-control-wrapper {
    width: 220px !important;
    max-width: min(220px, 100%);
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    opacity: 1 !important;
    box-sizing: border-box;
}

.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper .e-search input.e-input,
.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper input.e-input,
.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper input[type="search"] {
    height: 32px !important;
    min-height: 32px !important;
    line-height: 32px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    box-sizing: border-box;
}

.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper .e-search .e-search-icon,
.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper .e-input-group-icon {
    min-height: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    width: 32px !important;
    margin-top: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard__table .e-grid .e-toolbar .e-toolbar-item.e-search-wrapper .e-sicon.e-clear-icon {
    min-width: 28px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--dp-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--dp-primary-rgb), 0.15);
}

/* —— Nav tabs (Other Employees etc.) —— */
.nav-tabs .nav-link.active {
    color: var(--dp-primary) !important;
    border-color: var(--dp-border) var(--dp-border) var(--dp-surface) !important;
    font-weight: 600;
}

.nav-tabs .nav-link:hover {
    color: var(--dp-primary);
}

/* —— SweetAlert confirm —— */
.swal2-styled.swal2-confirm {
    background-color: var(--dp-primary) !important;
}

.swal2-styled.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(var(--dp-primary-rgb), 0.35) !important;
}
