/*
 |--------------------------------------------------------------------------
 | Almas Global Styles
 |--------------------------------------------------------------------------
 | Make Filament inline TextInputColumn fields look like regular TextColumn
 | until the user focuses the input to edit.
 */

/* Styles for the sidebar */
.fi-sidebar-group-label {
    color: #2CA58D;
    font-weight: 700;
}

/* Page heading: company logo and name shown on the right side. */
.vms-page-header-brand {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-inline-start: 0.75rem;
    white-space: nowrap;
}

.vms-page-header-brand__logo {
    height: 5rem;
    width: auto;
    max-width: 20rem;
    object-fit: contain;
    display: block;
}

.vms-page-header-brand__name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800, #1f2937);
}

@media (max-width: 1023px) {
    .vms-page-header-brand {
        gap: 0.5rem;
    }

    .vms-page-header-brand__logo {
        height: 3.6rem;
        max-width: 14rem;
    }

    .vms-page-header-brand__name {
        font-size: 0.95rem;
    }
}

.fi-sidebar-group-btn {
    border-inline-start: 3px solid #2CA58D;
    padding-inline-start: 0.5rem;
}

/* Active nav item: keep text color unchanged, only bg changes */
.fi-sidebar-nav-item-button[aria-current="page"] span,
.fi-sidebar-nav-item-button[aria-current="page"] svg {
    color: inherit !important;
}

/* Keep left sidebar icons compact and consistent. */
.fi-sidebar .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-item-icon.fi-icon,
.fi-sidebar .fi-sidebar-item-btn > .fi-icon,
.fi-sidebar .fi-sidebar-open-collapse-sidebar-btn .fi-icon,
.fi-sidebar .fi-sidebar-close-collapse-sidebar-btn .fi-icon {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem !important;
    min-height: 1rem !important;
    max-width: 1rem !important;
    max-height: 1rem !important;
}



.fi-ta-text-input.editable .fi-input-wrp {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

.fi-ta-text-input.editable .fi-input.editable {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
    min-height: auto;
}

.fi-ta-text-input.editable .fi-input.editable:focus,
.fi-ta-text-input.editable .fi-input.editable:focus-visible {
    border-color: var(--gray-300, #d1d5db);
    background: #ffffff;
    box-shadow: 0 0 0 1px var(--gray-300, #d1d5db);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.fi-ta-text-input.editable .fi-input.editable::placeholder {
    color: var(--gray-400, #9ca3af);
}

.almas-help-text {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-500, #6b7280);
}


/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--color-primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.4rem 0.875rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.12s ease;
}
.btn-primary:hover {
    filter: brightness(0.88);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--color-secondary);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--color-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.12s ease;
}
.btn-secondary:hover {
    filter: brightness(0.88);
}
.btn-secondary--active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}
.btn-secondary--active:hover {
    filter: brightness(0.9);
}

/* Round bordered navigation buttons (single/double arrows). */
.btn-nev-prev,
.btn-nev-next,
.btn-nev-fast-prev,
.btn-nev-fast-next,
.btn-nev-week,
.btn-nev-month {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--color-secondary);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-nev-prev::before {
    content: "\2039";
}

.btn-nev-next::before {
    content: "\203A";
}

.btn-nev-fast-prev::before {
    content: "\00AB";
}

.btn-nev-fast-next::before {
    content: "\00BB";
}

.btn-nev-week::before {
    content: "\1F5D3";
    font-size: 0.95rem;
}

.btn-nev-month::before {
    content: "\1F4C5";
    font-size: 0.95rem;
}

.btn-nev-prev:hover,
.btn-nev-next:hover,
.btn-nev-fast-prev:hover,
.btn-nev-fast-next:hover,
.btn-nev-week:hover,
.btn-nev-month:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: color-mix(in srgb, var(--color-secondary) 78%, #0f172a 22%);
}

.btn-nev-prev:focus-visible,
.btn-nev-next:focus-visible,
.btn-nev-fast-prev:focus-visible,
.btn-nev-fast-next:focus-visible,
.btn-nev-week:focus-visible,
.btn-nev-month:focus-visible {
    outline: 2px solid #2ca58d;
    outline-offset: 2px;
}

.btn-nev-week.btn-nev-icon--active,
.btn-nev-month.btn-nev-icon--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

/* Generic round icon action button (used for week/month/apply controls). */
.btn-nev-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--color-secondary);
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-nev-icon:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: color-mix(in srgb, var(--color-secondary) 78%, #0f172a 22%);
}

.btn-nev-icon--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.btn-nev-icon--active:hover {
    filter: brightness(0.95);
}

.btn-nev-icon:focus-visible {
    outline: 2px solid #2ca58d;
    outline-offset: 2px;
}

.btn-nev-icon--refresh {
    color: var(--color-secondary);
}

.btn-nev-icon--refresh svg {
    width: 0.75rem;
    height: 0.75rem;
}

.btn-nev-icon--secondary {
    color: var(--color-secondary);
}

.btn-nev-icon--secondary:hover {
    color: color-mix(in srgb, var(--color-secondary) 78%, #0f172a 22%);
}

/* Plain icon mode for top filter controls (no circular button chrome). */
.btn-nev-plain {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0.1rem 0.2rem;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.btn-nev-plain:hover {
    background: transparent;
    border-color: transparent;
}

.btn-nev-plain.btn-nev-prev,
.btn-nev-plain.btn-nev-next {
    font-size: 1.9rem;
    line-height: 1;
}

.btn-nev-plain.btn-nev-icon--refresh svg {
    width: 1.35rem;
    height: 1.35rem;
}

.btn-nev-plain.btn-nev-icon--active {
    background: transparent;
    border-color: transparent;
    color: var(--color-secondary);
}

.btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--color-danger, #dc2626);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.4rem 0.875rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.12s ease;
}
.btn-delete:hover {
    filter: brightness(0.88);
}

/* Secondary Filament buttons should keep white foreground for contrast. */
.fi-btn.fi-color[style*="--color-500:var(--secondary-500)"],
.fi-btn.fi-color[style*="--color-500: var(--secondary-500)"] {
    color: #fff !important;
}

.fi-btn.fi-color[style*="--color-500:var(--secondary-500)"] > .fi-icon,
.fi-btn.fi-color[style*="--color-500: var(--secondary-500)"] > .fi-icon,
.fi-btn.fi-color[style*="--color-500:var(--secondary-500)"] .fi-loading-indicator,
.fi-btn.fi-color[style*="--color-500: var(--secondary-500)"] .fi-loading-indicator {
    color: #fff !important;
}

.badge {
    background: var(--color-secondary);
}

tr:hover {
    background: rgba(44, 165, 141, 0.05);
}

:focus {
    outline: 2px solid var(--color-accent);
}

/* Filament modal backgrounds */
.fi-modal-window,
.fi-modal-content,
.fi-modal-header,
.fi-modal-body,
.fi-modal-footer {
    background-color: var(--color-surface) !important;
}

/* Reusable modal table styles for Filament modal content. */
.almas-modal-table-wrap {
    margin-top: 0.75rem;
    overflow-x: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0 0 1px #e5e7eb inset;
}

.almas-modal-table {
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.almas-modal-table thead tr {
    background: #f9fafb;
}

.almas-modal-th {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
    text-align: left;
}

.almas-modal-th--center {
    text-align: center;
}

.almas-modal-th--right {
    text-align: right;
}

/* View page: render disabled form controls like read-only text fields. */
.fi-resource-view-record-page .fi-fo-field-wrp input[disabled],
.fi-resource-view-record-page .fi-fo-field-wrp textarea[disabled],
.fi-resource-view-record-page .fi-fo-field-wrp select[disabled] {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid var(--color-border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--color-neutral) !important;
    padding-inline: 0 !important;
}

/* Global label style tokens for Filament form labels. */
:root {
    --vms-label-color: #334155;
    --vms-label-size: 0.7rem;
    --vms-label-weight: 700;
    --vms-label-spacing: 0.06em;
}

.vms-label,
.fi-fo-field-wrp-label > span {
    color: var(--vms-label-color) !important;
    font-size: var(--vms-label-size) !important;
    font-weight: var(--vms-label-weight) !important;
    letter-spacing: var(--vms-label-spacing) !important;
    text-transform: uppercase;
}

/* Explicit page usage hook for Employee view form. */
.vms-view-employee .fi-fo-field-wrp-label > span {
    color: var(--vms-label-color) !important;
}

/* Fallback sizing for Filament icons when theme component CSS is not present. */
.fi-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.fi-icon.fi-size-xs {
    width: 0.75rem;
    height: 0.75rem;
}

.fi-icon.fi-size-sm {
    width: 1rem;
    height: 1rem;
}

.fi-icon.fi-size-md {
    width: 1.25rem;
    height: 1.25rem;
}

.fi-icon.fi-size-lg {
    width: 1.5rem;
    height: 1.5rem;
}

.fi-icon.fi-size-xl {
    width: 1.75rem;
    height: 1.75rem;
}

.fi-icon.fi-size-2xl {
    width: 2rem;
    height: 2rem;
}

.fi-icon > svg {
    width: inherit;
    height: inherit;
}

/* Employee view: show a left separator for each cell in the right 4-column details grid. */
.vms-right-details-grid > * {
    border-left: 1px solid #e5e7eb;
    padding-left: 0.75rem;
}

/* Reusable action icon styles for table-like lists. */
.almas-table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.almas-table-action {
    --almas-action-color: #2ca58d;
    --almas-action-border: #cbd5e1;
    width: 2rem;
    height: 2rem;
    margin-inline: 0.12rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--almas-action-border);
    border-radius: 0.55rem;
    background: #ffffff;
    color: var(--almas-action-color);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.almas-table-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1);
    filter: brightness(0.95);
}

.almas-table-action:focus-visible {
    outline: 2px solid rgba(44, 165, 141, 0.3);
    outline-offset: 2px;
}

.almas-table-action .almas-action-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.almas-table-action .fi-icon {
    width: 1.1rem !important;
    height: 1.1rem !important;
}

.almas-table-action--view {
    --almas-action-color: #2ca58d;
    --almas-action-border: #a7f3d0;
}

.almas-table-action--edit {
    --almas-action-color: #2563eb;
    --almas-action-border: #bfdbfe;
}

.almas-table-action--delete {
    --almas-action-color: #dc2626;
    --almas-action-border: #fecaca;
}

.almas-table-action--download {
    --almas-action-color: #475569;
    --almas-action-border: #cbd5e1;
}

/* Time Sheets: status badges */
.vms-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 0.375rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.vms-status-badge--present {
    background: #ecfdf5;
    color: #065f46;
    border-color: #6ee7b7;
}

.vms-status-badge--absent {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fca5a5;
}

.vms-status-badge--late {
    background: #fffbeb;
    color: #92400e;
    border-color: #fcd34d;
}

.vms-status-badge--leave {
    background: #eff6ff;
    color: #1e40af;
    border-color: #93c5fd;
}

.vms-status-badge--weekoff {
    background: #f5f3ff;
    color: #5b21b6;
    border-color: #c4b5fd;
}

.vms-status-badge--holiday {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fdba74;
}

.vms-status-badge--default {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}

/* Single-week modal: emphasize selected day type with text color. */
.vms-daytype-select--regular {
    color: #0f766e;
}

.vms-daytype-select--weekoff {
    color: #6d28d9;
}

.vms-daytype-select--holiday {
    color: #c2410c;
}

.vms-daytype-select--leave {
    color: #1d4ed8;
}

.vms-daytype-select--absent {
    color: #b91c1c;
}

/* Employees list: hide filter reset link in filters header. */
.fi-resource-employees-list-records-page [wire\:click="resetTableFiltersForm"],
.fi-resource-employees-pages-list-employees [wire\:click="resetTableFiltersForm"],
.fi-resource-employees [wire\:click="resetTableFiltersForm"] {
    display: none !important;
}



