/* Ibtdara HRMS — table layout fixes (Bug Report v2 #01–#03) */
.hrms-data-table {
    display: table !important;
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
.hrms-data-table thead { display: table-header-group !important; }
.hrms-data-table tbody { display: table-row-group !important; }
.hrms-data-table tr { display: table-row !important; }
.hrms-data-table th,
.hrms-data-table td {
    display: table-cell !important;
    vertical-align: middle;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
}
.hrms-data-table th.hrms-wrap,
.hrms-data-table td.hrms-wrap { white-space: normal; }
.hrms-data-table-wrap { overflow-x: auto; width: 100%; }

/* Filament resource tables: keep columns as real table cells on desktop */
@media (min-width: 640px) {
    .fi-ta-table { display: table !important; width: 100%; }
    .fi-ta-table > thead { display: table-header-group !important; }
    .fi-ta-table > tbody { display: table-row-group !important; }
    .fi-ta-table > thead > tr,
    .fi-ta-table > tbody > tr { display: table-row !important; }
    .fi-ta-table .fi-ta-header-cell,
    .fi-ta-table .fi-ta-cell { display: table-cell !important; }
}

/* Bug Report v3 #08 — Monthly attendance calendar grid */
.hrms-cal { width: 100%; }
.hrms-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.75rem;
}
.hrms-cal-month {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.hrms-cal-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 0.5rem;
    width: 100%;
}
.hrms-cal-head {
    margin-bottom: 0.35rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}
.hrms-cal-cell {
    min-height: 4.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.45rem 0.5rem;
    background: #fff;
}
.dark .hrms-cal-cell { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); }
.hrms-cal-out { opacity: 0.35; }
.hrms-cal-cell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hrms-cal-day { font-size: 0.75rem; font-weight: 700; }
.hrms-cal-dot {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: currentColor;
}
.hrms-cal-label {
    margin: 0.4rem 0 0;
    font-size: 0.65rem;
    line-height: 1.2;
    text-transform: capitalize;
    color: #4b5563;
}
.dark .hrms-cal-label { color: #d1d5db; }
.hrms-cal-present { color: #10b981; background-color: rgba(16,185,129,0.12) !important; }
.hrms-cal-late { color: #f59e0b; background-color: rgba(245,158,11,0.14) !important; }
.hrms-cal-half { color: #f97316; background-color: rgba(249,115,22,0.14) !important; }
.hrms-cal-absent { color: #f43f5e; background-color: rgba(244,63,94,0.12) !important; }
.hrms-cal-leave { color: #0ea5e9; background-color: rgba(14,165,233,0.12) !important; }
.hrms-cal-holiday { color: #8b5cf6; background-color: rgba(139,92,246,0.12) !important; }
.hrms-cal-weekend { color: #9ca3af; background-color: #f3f4f6 !important; }
.dark .hrms-cal-weekend { background-color: rgba(255,255,255,0.06) !important; }
.hrms-cal-empty { color: #d1d5db; }
.hrms-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #4b5563;
}
.hrms-cal-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.hrms-cal-legend i {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: currentColor;
}

/* Bug Report v3 #10 — Forced password change inputs */
.hrms-password-field { display: flex; flex-direction: column; gap: 0.35rem; }
.hrms-password-input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #9ca3af !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    outline: none;
}
.hrms-password-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
}
.dark .hrms-password-input {
    border-color: rgba(255,255,255,0.35) !important;
    background-color: rgba(15,23,42,0.85) !important;
    color: #f9fafb !important;
}
