/**
 * ImmigraSuite Admin - Roster Planner & My Roster
 * Monthly grid showing each employee's working days, overrides, and swaps.
 */

/* ==========================================================================
   Roster Planner page wrapper
   ========================================================================== */

.is-roster-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   Filter bar
   ========================================================================== */

.is-roster-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background-color: rgb(249 250 251);
    border: 1px solid rgb(229 231 235);
    border-radius: 8px;
}

.is-roster-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.is-roster-filter-label {
    font-size: 11px;
    font-weight: 600;
    color: rgb(107 114 128);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.is-roster-filter-select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid rgb(209 213 219);
    border-radius: 6px;
    background-color: white;
    color: rgb(17 24 39);
}

.dark .is-roster-filters {
    background-color: rgb(31 41 55);
    border-color: rgb(55 65 81);
}

.dark .is-roster-filter-label {
    color: rgb(156 163 175);
}

.dark .is-roster-filter-select {
    background-color: rgb(17 24 39);
    border-color: rgb(75 85 99);
    color: rgb(243 244 246);
}

/* ==========================================================================
   Legend
   ========================================================================== */

.is-roster-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 8px 16px;
    background-color: rgb(255 255 255);
    border: 1px solid rgb(229 231 235);
    border-radius: 8px;
    font-size: 12px;
    color: rgb(75 85 99);
}

.is-roster-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.is-roster-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgb(229 231 235);
}

.is-roster-swatch-working { background-color: rgb(209 250 229); }
.is-roster-swatch-off { background-color: rgb(243 244 246); }
.is-roster-swatch-override-on { background-color: rgb(191 219 254); }
.is-roster-swatch-override-off { background-color: rgb(254 202 202); }
.is-roster-swatch-swap { background-color: rgb(233 213 255); }

.dark .is-roster-legend {
    background-color: rgb(31 41 55);
    border-color: rgb(55 65 81);
    color: rgb(209 213 219);
}

.dark .is-roster-swatch {
    border-color: rgb(75 85 99);
}

/* ==========================================================================
   Roster grid table
   ========================================================================== */

.is-roster-table-wrap {
    overflow-x: auto;
    background-color: white;
    border: 1px solid rgb(229 231 235);
    border-radius: 8px;
}

.is-roster-table {
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.is-roster-table thead tr {
    background-color: rgb(249 250 251);
}

.is-roster-table th,
.is-roster-table td {
    border-bottom: 1px solid rgb(243 244 246);
}

/* Sticky employee column */
.is-roster-th-employee,
.is-roster-employee-cell {
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 1;
    text-align: left;
    padding: 10px 14px;
    min-width: 200px;
    border-right: 1px solid rgb(229 231 235);
}

.is-roster-th-employee {
    background-color: rgb(249 250 251);
    font-size: 12px;
    font-weight: 600;
    color: rgb(55 65 81);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.is-roster-employee-name {
    font-weight: 500;
    color: rgb(17 24 39);
    font-size: 13px;
}

.is-roster-employee-pattern {
    font-size: 11px;
    color: rgb(107 114 128);
    margin-top: 2px;
}

/* Day column headers */
.is-roster-th-day {
    text-align: center;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 500;
    color: rgb(75 85 99);
    min-width: 36px;
}

.is-roster-th-day-num {
    font-size: 13px;
    font-weight: 600;
    color: rgb(17 24 39);
}

.is-roster-th-day-name {
    font-size: 10px;
    color: rgb(107 114 128);
    margin-top: 1px;
}

.is-roster-th-weekend {
    background-color: rgb(243 244 246);
}

.is-roster-th-today {
    background-color: rgb(254 243 199);
}

/* Day cells */
.is-roster-cell {
    text-align: center;
    padding: 4px 2px;
    border: 1px solid white;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    min-height: 32px;
    vertical-align: middle;
}

.is-roster-cell-working { background-color: rgb(209 250 229); color: rgb(6 95 70); }
.is-roster-cell-off { background-color: rgb(243 244 246); color: rgb(156 163 175); }
.is-roster-cell-override-on { background-color: rgb(191 219 254); color: rgb(30 58 138); }
.is-roster-cell-override-off { background-color: rgb(254 202 202); color: rgb(127 29 29); }
.is-roster-cell-swap { background-color: rgb(233 213 255); color: rgb(88 28 135); }

.is-roster-cell-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.is-roster-cell-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: 600;
    color: inherit;
}

.is-roster-cell-btn:focus {
    outline: 2px solid rgb(59 130 246);
    outline-offset: -2px;
}

.is-roster-cell-clear {
    background: none;
    border: none;
    padding: 0;
    color: rgb(107 114 128);
    font-size: 11px;
    cursor: pointer;
    line-height: 1;
}

.is-roster-cell-clear:hover {
    color: rgb(220 38 38);
}

/* Empty state */
.is-roster-empty {
    padding: 32px;
    text-align: center;
    color: rgb(107 114 128);
    font-size: 14px;
}

/* Dark mode */
.dark .is-roster-table-wrap {
    background-color: rgb(17 24 39);
    border-color: rgb(55 65 81);
}

.dark .is-roster-table thead tr {
    background-color: rgb(31 41 55);
}

.dark .is-roster-table th,
.dark .is-roster-table td {
    border-bottom-color: rgb(55 65 81);
}

.dark .is-roster-th-employee,
.dark .is-roster-employee-cell {
    background-color: rgb(17 24 39);
    border-right-color: rgb(55 65 81);
    color: rgb(243 244 246);
}

.dark .is-roster-th-employee {
    background-color: rgb(31 41 55);
    color: rgb(209 213 219);
}

.dark .is-roster-employee-name {
    color: rgb(243 244 246);
}

.dark .is-roster-employee-pattern {
    color: rgb(156 163 175);
}

.dark .is-roster-th-day {
    color: rgb(209 213 219);
}

.dark .is-roster-th-day-num {
    color: rgb(243 244 246);
}

.dark .is-roster-th-day-name {
    color: rgb(156 163 175);
}

.dark .is-roster-th-weekend {
    background-color: rgb(55 65 81);
}

.dark .is-roster-th-today {
    background-color: rgb(120 53 15);
}

/* Cell colors slightly darker on dark backgrounds */
.dark .is-roster-cell-working { background-color: rgb(6 78 59); color: rgb(167 243 208); }
.dark .is-roster-cell-off { background-color: rgb(31 41 55); color: rgb(107 114 128); }
.dark .is-roster-cell-override-on { background-color: rgb(30 58 138); color: rgb(191 219 254); }
.dark .is-roster-cell-override-off { background-color: rgb(127 29 29); color: rgb(254 202 202); }
.dark .is-roster-cell-swap { background-color: rgb(88 28 135); color: rgb(233 213 255); }

.dark .is-roster-cell {
    border-color: rgb(17 24 39);
}

.dark .is-roster-empty {
    color: rgb(156 163 175);
}

/* ==========================================================================
   My Roster (employee self-service)
   ========================================================================== */

.is-my-roster-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Combined header card: pattern + stats + filters in one row */
.is-my-roster-info {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background-color: rgb(255 255 255);
    border: 1px solid rgb(229 231 235);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.is-my-roster-info-left {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
}

.is-my-roster-info-filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.is-my-roster-info-pattern {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
}

.is-my-roster-info-label {
    font-size: 11px;
    font-weight: 600;
    color: rgb(107 114 128);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.is-my-roster-info-name {
    font-size: 16px;
    font-weight: 600;
    color: rgb(17 24 39);
}

.is-my-roster-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.is-my-roster-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    background-color: rgb(249 250 251);
    border-radius: 8px;
    min-width: 72px;
}

.is-my-roster-stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    color: rgb(17 24 39);
}

.is-my-roster-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: rgb(107 114 128);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.is-my-roster-stat-working .is-my-roster-stat-value { color: rgb(5 150 105); }
.is-my-roster-stat-off .is-my-roster-stat-value     { color: rgb(107 114 128); }
.is-my-roster-stat-override .is-my-roster-stat-value { color: rgb(37 99 235); }
.is-my-roster-stat-swap .is-my-roster-stat-value     { color: rgb(124 58 237); }

/* Filter toolbar */
.is-my-roster-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 12px 16px;
    background-color: rgb(249 250 251);
    border: 1px solid rgb(229 231 235);
    border-radius: 8px;
}

/* Table */
.is-my-roster-table-wrap {
    background-color: white;
    border: 1px solid rgb(229 231 235);
    border-radius: 10px;
    overflow: hidden;
}

.is-my-roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.is-my-roster-table thead tr {
    background-color: rgb(249 250 251);
}

.is-my-roster-table th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid rgb(229 231 235);
    font-size: 11px;
    font-weight: 600;
    color: rgb(75 85 99);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.is-my-roster-table th.is-text-center { text-align: center; }

.is-my-roster-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgb(243 244 246);
    color: rgb(31 41 55);
}

.is-my-roster-table td.is-text-center { text-align: center; }

.is-my-roster-table tbody tr:hover {
    background-color: rgb(249 250 251);
}

.is-my-roster-row-today { background-color: rgb(254 243 199) !important; font-weight: 600; }
.is-my-roster-row-today:hover { background-color: rgb(253 230 138) !important; }
.is-my-roster-row-off td { color: rgb(107 114 128); }

.is-my-roster-date {
    font-weight: 500;
}

.is-my-roster-day-name { color: rgb(107 114 128); }
.is-my-roster-shift-empty { color: rgb(156 163 175); }

/* Working / Off pill badges */
.is-my-roster-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.2;
}

.is-my-roster-status-working {
    background-color: rgb(209 250 229);
    color: rgb(6 95 70);
}

.is-my-roster-status-off {
    background-color: rgb(243 244 246);
    color: rgb(75 85 99);
}

/* Source badges */
.is-my-roster-source {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    line-height: 1.3;
}

.is-my-roster-source-pattern {
    background-color: rgb(243 244 246);
    color: rgb(75 85 99);
}

.is-my-roster-source-swap {
    background-color: rgb(233 213 255);
    color: rgb(88 28 135);
}

.is-my-roster-source-override {
    background-color: rgb(191 219 254);
    color: rgb(30 58 138);
}

/* Dark mode */
.dark .is-my-roster-info {
    background-color: rgb(31 41 55);
    border-color: rgb(55 65 81);
    box-shadow: none;
}
.dark .is-my-roster-info-name { color: rgb(243 244 246); }
.dark .is-my-roster-info-label { color: rgb(156 163 175); }

.dark .is-my-roster-stat { background-color: rgb(17 24 39); }
.dark .is-my-roster-stat-value { color: rgb(243 244 246); }
.dark .is-my-roster-stat-label { color: rgb(156 163 175); }

.dark .is-my-roster-toolbar {
    background-color: rgb(31 41 55);
    border-color: rgb(55 65 81);
}

.dark .is-my-roster-table-wrap {
    background-color: rgb(17 24 39);
    border-color: rgb(55 65 81);
}
.dark .is-my-roster-table thead tr { background-color: rgb(31 41 55); }
.dark .is-my-roster-table th {
    border-bottom-color: rgb(55 65 81);
    color: rgb(209 213 219);
}
.dark .is-my-roster-table td {
    border-bottom-color: rgb(55 65 81);
    color: rgb(229 231 235);
}
.dark .is-my-roster-table tbody tr:hover { background-color: rgb(31 41 55); }

.dark .is-my-roster-row-today {
    background-color: rgb(120 53 15) !important;
    color: rgb(254 243 199);
}
.dark .is-my-roster-row-today:hover { background-color: rgb(146 64 14) !important; }
.dark .is-my-roster-row-off td { color: rgb(156 163 175); }

.dark .is-my-roster-day-name { color: rgb(156 163 175); }

.dark .is-my-roster-status-working {
    background-color: rgb(6 78 59);
    color: rgb(167 243 208);
}
.dark .is-my-roster-status-off {
    background-color: rgb(55 65 81);
    color: rgb(209 213 219);
}

.dark .is-my-roster-source-pattern {
    background-color: rgb(55 65 81);
    color: rgb(209 213 219);
}
.dark .is-my-roster-source-swap {
    background-color: rgb(88 28 135);
    color: rgb(233 213 255);
}
.dark .is-my-roster-source-override {
    background-color: rgb(30 58 138);
    color: rgb(191 219 254);
}
.dark .is-my-roster-row-today { background-color: rgb(120 53 15); }
.dark .is-my-roster-row-off { background-color: rgb(31 41 55); }
.dark .is-my-roster-day-name { color: rgb(156 163 175); }
.dark .is-my-roster-source-pattern { color: rgb(156 163 175); }
.dark .is-my-roster-source-swap { color: rgb(196 181 253); }
.dark .is-my-roster-source-override { color: rgb(147 197 253); }
