/* Non-scoped CSS for TimeRegSchema - needed because selectors target Syncfusion internal elements */

.e-grid .e-rowcell, .e-grid .e-headercell {
    border-left: 1px solid var(--color-sf-border-light) !important;
}

.e-grid .e-headercell {
    font-weight: bold !important;
}

/* Ensure icon buttons in header cells render at standard size despite grid theme compact rules */
.e-grid .e-headercell .e-icon-btn {
    height: 32px !important;
    width: 32px !important;
    min-height: 32px !important;
    min-width: 32px !important;
}

.e-grid {
    border: 1px solid var(--color-sf-border-light) !important;
}

/* Scrollable container for the main time registration grid */
.timereg-schema-container {
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    position: relative;
}

/* Main grid should allow sticky positioning */
.timereg-main-grid {
    position: relative;
}

/* Sticky header for the main grid */
.timereg-sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--color-sf-content-bg-color-alt1);
}

.timereg-sticky-header .e-table {
    background-color: var(--color-sf-content-bg-color-alt1);
}

.timereg-sticky-header .e-headercell {
    background-color: var(--color-sf-content-bg-color-alt2);
}

.e-custom-margin {
    margin-right: 5px;
}

/* Force fixed table layout so colgroup widths are respected */
.timereg-fixed-table {
    table-layout: fixed;
    width: 100%;
}

/* Right-align text in all table cells */
.e-grid .e-rowcell {
    text-align: right !important;
}

/* Right-align text in input boxes */
.e-grid .e-textbox {
    text-align: right !important;
}

.linear-progress {
    width: 100%;
}

/* Fixed width for day columns */
.day-column {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

/* Fixed width for Total columns */
.total-column {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

/* Left-align text in name columns with ellipsis truncation */
.e-grid .e-rowcell.name-column,
.e-grid .e-headercell.name-column {
    text-align: left !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 150px !important;
    max-width: 150px !important;
    cursor: default;
}

/* Left-align text in rate column with ellipsis truncation */
.e-grid .e-rowcell.rate-column,
.e-grid .e-headercell.rate-column {
    text-align: left !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 50px !important;
    max-width: 50px !important;
    cursor: default;
}

/* Remove border from empty cells - use higher specificity to override .e-grid .e-rowcell */
.e-grid .e-rowcell.empty-cell {
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* Ensure last data column before empty cells has right border */
.e-grid .e-rowcell.last-data-cell {
    border-right: 1px solid var(--color-sf-border-light) !important;
}

/* Make data rows with input boxes more compact */
.e-grid .e-row .e-rowcell {
    padding: 4px 8px !important;
}

.e-grid .e-row .e-textbox {
    height: 28px !important;
    padding: 2px 6px !important;
}

.e-grid .e-row .e-input-group {
    height: 28px !important;
}

/* Make summary/total rows more compact */
.e-grid .e-summaryrow .e-rowcell {
    padding: 4px 8px !important;
}

/* Time registration cell container */
.timereg-cell-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timereg-cell-container .timereg-input {
    flex: 1;
}

.timereg-popup-btn {
    min-width: 24px !important;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    font-size: 11px !important;
    border-radius: 50% !important;
    background-color: var(--color-sf-primary) !important;
    color: var(--color-sf-primary-text-color) !important;
}

.timereg-popup-btn:hover {
    background-color: var(--color-sf-primary-bg-color-hover) !important;
}

/* Popup overlay */
.timereg-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

/* Popup container - uses Syncfusion e-popup classes for theme awareness */
.timereg-popup {
    position: absolute;
    z-index: 1000;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-width: 280px;
    margin-top: 4px;
    background-color: var(--color-sf-flyout-bg-color);
    border: 1px solid var(--color-sf-flyout-border);
}

.timereg-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px !important;
    font-weight: 600;
    font-size: 13px;
}

.timereg-popup-header .e-dlg-header {
    font-size: 13px;
    font-weight: 600;
}

.timereg-popup-content {
    padding: 8px !important;
    max-height: 250px;
    overflow-y: auto;
}

.timereg-popup-item {
    margin-bottom: 6px;
}

.timereg-popup-item:last-child {
    margin-bottom: 0;
}

.timereg-popup-item-btn {
    width: 100%;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 6px 10px !important;
}

.timereg-item-index {
    font-weight: 600;
    margin-right: 8px;
    min-width: 16px;
}

.timereg-item-time {
    flex: 1;
}

.timereg-transport-badge {
    margin-left: 6px;
    font-size: 10px;
    padding: 2px 5px;
}

.timereg-item-comment {
    font-size: 11px;
    color: var(--color-sf-content-text-color-alt2);
    padding: 2px 10px 0 34px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
