/* =============================================
   ROTA BUILDER STYLES
   ============================================= */

/* Container */
.swp_rota_container {
    padding: 15px;
    min-height: 400px;
    overflow: hidden;
}

/* Ensure popup tab content allows scrolling */
#swp_rota_table_container {
    overflow: visible;
}

#swp_rota_table_container .swp_rota_table_wrap {
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-width: 100%;
    display: block;
}

/* Tab content areas */
.swp_rota_tab_content {
    display: none;
}

.swp_rota_tab_content.active {
    display: block;
}

/* Empty state */
.swp_rota_empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 15px;
}

.swp_rota_empty i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
    display: block;
}

/* =============================================
   ROTA TABLE
   ============================================= */

.swp_rota_table_wrap {
    overflow-x: auto;
    overflow-y: auto;
    margin: 15px 0;
    max-height: 70vh;
    position: relative;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
}

/* Scrollbar styling */
.swp_rota_table_wrap::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.swp_rota_table_wrap::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.swp_rota_table_wrap::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.swp_rota_table_wrap::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Ensure the table doesn't shrink */
.swp_rota_table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.swp_rota_table th {
    background: #f8f9fa;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 20;
}

.swp_rota_table th:last-child {
    border-right: none;
}

/* Sticky first column (Date) */
.swp_rota_table th.swp_rota_th_date,
.swp_rota_table td.swp_rota_td_date {
    position: sticky;
    left: 0;
    z-index: 15;
    background: #f8f9fa;
}

.swp_rota_table td.swp_rota_td_date {
    background: #fff;
    border-right: 2px solid #dee2e6;
}

/* Top-left corner cell needs highest z-index */
.swp_rota_table th.swp_rota_th_date {
    z-index: 25;
    border-right: 2px solid #dee2e6;
}

.swp_rota_table th.swp_rota_th_date {
    min-width: 140px;
}

.swp_rota_table th.swp_rota_th_role {
    min-width: 160px;
}

.swp_rota_th_content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.swp_rota_th_content span {
    flex: 1;
}

.swp_rota_col_clear {
    font-size: 14px;
    color: #ccc;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0;
}

.swp_rota_table th:hover .swp_rota_col_clear {
    opacity: 1;
}

.swp_rota_col_clear:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.swp_rota_table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #e0e0e0;
    vertical-align: top;
}

.swp_rota_table td:last-child {
    border-right: none;
}

/* Alternating row colors */
.swp_rota_table tbody tr:nth-child(odd) td {
    background: #fff;
}

.swp_rota_table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

/* Keep sticky column colors consistent */
.swp_rota_table tbody tr:nth-child(odd) td.swp_rota_td_date {
    background: #fff;
}

.swp_rota_table tbody tr:nth-child(even) td.swp_rota_td_date {
    background: #f8fafc;
}

.swp_rota_table tr:hover td {
    background: #eef2ff !important;
}

.swp_rota_table tr:hover td.swp_rota_td_date {
    background: #eef2ff !important;
}

/* Date cell */
.swp_rota_td_date {
    font-weight: 500;
    white-space: nowrap;
}

.swp_rota_td_date .swp_rota_date_label {
    display: block;
    font-size: 12px;
    color: #888;
    font-weight: 400;
    margin-top: 2px;
}

/* Assignment cell */
.swp_rota_td_assign {
    min-width: 150px;
}

.swp_rota_assignment {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.swp_rota_person_primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #e8f4fd;
    border-radius: 6px;
    font-size: 13px;
}

.swp_rota_person_primary .swp_rota_role_label {
    font-size: 10px;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
}

.swp_rota_person_helper {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
}

.swp_rota_person_helper .swp_rota_role_label {
    font-size: 10px;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
}

/* Team member (no hierarchy) */
.swp_rota_person_team {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #f3e8ff;
    border-radius: 5px;
    font-size: 13px;
    color: #6b21a8;
}

.swp_rota_unassigned {
    color: #ccc;
    font-style: italic;
    padding: 6px 10px;
    border: 1px dashed #ddd;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.swp_rota_unassigned:hover {
    border-color: #007bff;
    color: #007bff;
}

/* Actions column */
.swp_rota_td_actions {
    width: 80px;
    text-align: center;
    white-space: nowrap;
}

.swp_rota_td_actions i {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.5;
    margin: 0 4px;
    transition: opacity 0.2s;
}

.swp_rota_td_actions i:hover {
    opacity: 1;
}

.swp_rota_td_actions .la-pen {
    color: #007bff;
}

.swp_rota_td_actions .la-trash {
    color: #dc3545;
}

.swp_rota_td_actions .la-envelope {
    color: #28a745;
}

/* =============================================
   COLUMN HEADER ACTIONS
   ============================================= */

.swp_rota_th_actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.swp_rota_th_actions i {
    font-size: 14px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.swp_rota_th_actions i:hover {
    opacity: 1;
}

/* =============================================
   TOOLBAR
   ============================================= */

.swp_rota_toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.swp_rota_toolbar button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Toolbar icon buttons */
.swp_rota_toolbar_icons {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 8px;
}

.swp_rota_toolbar_icons>i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 16px;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.swp_rota_toolbar_icons>i:hover {
    background: #fff;
    color: var(--accent1, #2a9d90);
}

.swp_rota_toolbar_icons>i.swp_rota_icon_muted {
    opacity: 0.5;
}

.swp_rota_toolbar_icons>i.swp_rota_icon_disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Toolbar dropdown buttons */
.swp_rota_toolbar_dropdowns {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* =============================================
   SETTINGS TAB
   ============================================= */

.swp_rota_settings_section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.swp_rota_settings_section:last-child {
    border-bottom: none;
}

.swp_rota_settings_title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.swp_rota_settings_desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

/* Column/Role list */
.swp_rota_columns_list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.swp_rota_column_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.swp_rota_column_item .swp_rota_col_name {
    flex: 1;
    font-weight: 500;
}

.swp_rota_column_item .swp_rota_col_type {
    font-size: 11px;
    color: #888;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
}

.swp_rota_column_item .swp_rota_col_group {
    font-size: 11px;
    color: #007bff;
}

.swp_rota_column_item i {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.swp_rota_column_item i:hover {
    opacity: 1;
}

.swp_rota_column_item .la-pen {
    color: #007bff;
}

.swp_rota_column_item .la-trash {
    color: #dc3545;
}

.swp_rota_column_item .la-grip-lines {
    color: #999;
    cursor: grab;
}

/* Custom field type badge */
.swp_rota_col_custom {
    background: #e7f3ff !important;
    color: #0066cc !important;
}

.swp_rota_col_custom i {
    margin-right: 4px;
}

/* Custom field value in table */
.swp_rota_custom_value {
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    word-break: break-word;
}

/* =============================================
   DATABASE LIST ITEMS - PROFESSIONAL CARDS
   ============================================= */

/* Container */
.swp_databaseframe {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
}

/* Base item style */
.swp_dbitem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.swp_dbitem:hover {
    background: #fafafa;
    border-color: #d0d0d0;
}

/* Icon container */
.swp_dbitem_icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.swp_dbitem_icon i {
    font-size: 18px;
}

/* Content area */
.swp_dbitem_content {
    flex: 1;
    min-width: 0;
}

.swp_dbitem_title {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swp_dbitem_meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.swp_dbitem_type {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Arrow */
.swp_dbitem_arrow {
    color: #ccc;
    font-size: 14px;
    transition: color 0.15s ease;
}

.swp_dbitem:hover .swp_dbitem_arrow {
    color: #999;
}

/* Form styling - Slate Blue */
.swp_dbitem_form .swp_dbitem_icon {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

.swp_dbitem_form .swp_dbitem_type {
    color: #64748b;
}

.swp_dbitem_form:hover {
    border-left: 3px solid #64748b;
    padding-left: 11px;
}

/* Register styling - Muted Green */
.swp_dbitem_register .swp_dbitem_icon {
    background: #f0fdf4;
    border-color: #dcfce7;
    color: #059669;
}

.swp_dbitem_register .swp_dbitem_type {
    color: #059669;
}

.swp_dbitem_register:hover {
    border-left: 3px solid #059669;
    padding-left: 11px;
}

/* Rota styling - Muted Orange */
.swp_dbitem_rota .swp_dbitem_icon {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.swp_dbitem_rota .swp_dbitem_type {
    color: #c2410c;
}

.swp_dbitem_rota:hover {
    border-left: 3px solid #c2410c;
    padding-left: 11px;
}

/* Drag handle */
.swp_rota_drag_handle {
    cursor: grab;
    padding: 4px;
    margin-right: 4px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.swp_rota_drag_handle:hover {
    background: #e9ecef;
    color: #666;
}

.swp_rota_drag_handle:active {
    cursor: grabbing;
}

/* Dragging state */
.swp_rota_column_item.ui-sortable-helper {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.swp_rota_column_item.ui-sortable-placeholder {
    visibility: visible !important;
    background: #e8f4fd;
    border: 2px dashed #007bff;
    border-radius: 6px;
}

/* Add column button */
.swp_rota_add_column_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px dashed #ccc;
    border-radius: 6px;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.2s, color 0.2s;
}

.swp_rota_add_column_btn:hover {
    border-color: #007bff;
    color: #007bff;
}

/* =============================================
   PEOPLE TAB
   ============================================= */

.swp_rota_people_toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.swp_rota_people_list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.swp_rota_person_card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.swp_rota_person_card .swp_rota_person_info {
    flex: 1;
    min-width: 0;
}

.swp_rota_person_card .swp_rota_person_name {
    font-weight: 500;
    font-size: 14px;
    display: block;
}

.swp_rota_person_card .swp_rota_person_email {
    font-size: 11px;
    color: #888;
    display: block;
    margin-top: 2px;
}

.swp_rota_person_stats {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.swp_rota_person_stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
}

.swp_rota_person_stat i {
    font-size: 14px;
    opacity: 1 !important;
    cursor: default !important;
}

.swp_rota_stat_lead {
    color: #f59e0b;
}

.swp_rota_stat_lead i {
    color: #f59e0b;
}

.swp_rota_stat_helper {
    color: #8b5cf6;
}

.swp_rota_stat_helper i {
    color: #8b5cf6;
}

.swp_rota_person_roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.swp_rota_person_role {
    display: inline-block;
    padding: 2px 8px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 10px;
    font-size: 11px;
}

.swp_rota_person_card>i {
    cursor: pointer;
    opacity: 0.5;
    padding: 4px;
    margin-top: 4px;
}

.swp_rota_person_card>i:hover {
    opacity: 1;
}

.swp_rota_person_card>.la-trash {
    color: #dc3545;
}

/* =============================================
   ADD DATES MODAL
   ============================================= */

.swp_rota_dates_modal {
    max-width: 500px;
}

.swp_rota_date_option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin: 8px 0;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.swp_rota_date_option:hover {
    background: #f9fafb;
    border-color: #ccc;
}

.swp_rota_date_option.selected {
    background: #e8f4fd;
    border-color: #007bff;
}

.swp_rota_date_option input[type="radio"] {
    margin-top: 2px;
}

.swp_rota_date_option_content {
    flex: 1;
}

.swp_rota_date_option_title {
    font-weight: 500;
    margin-bottom: 4px;
}

.swp_rota_date_option_desc {
    font-size: 12px;
    color: #666;
}

.swp_rota_date_config {
    margin-top: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.swp_rota_date_config label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 500;
}

.swp_rota_date_config select,
.swp_rota_date_config input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
}

/* =============================================
   ASSIGNMENT MODAL
   ============================================= */

.swp_rota_assign_modal {
    max-width: 450px;
}

.swp_rota_assign_section {
    margin-bottom: 15px;
}

.swp_rota_assign_label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
}

.swp_rota_assign_sublabel {
    font-size: 11px;
    color: #888;
    font-weight: 400;
}

/* =============================================
   EMAIL PREVIEW MODAL
   ============================================= */

.swp_rota_email_modal {
    max-width: 600px;
}

.swp_rota_email_preview {
    margin: 15px 0;
}

.swp_rota_email_recipient {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
}

.swp_rota_email_recipient input[type="checkbox"] {
    margin-top: 3px;
}

.swp_rota_email_recipient_info {
    flex: 1;
}

.swp_rota_email_recipient_name {
    font-weight: 500;
}

.swp_rota_email_recipient_email {
    font-size: 12px;
    color: #888;
}

.swp_rota_email_recipient_duties {
    font-size: 12px;
    color: #333;
    margin-top: 4px;
}

.swp_rota_email_recipient_duties strong {
    color: #007bff;
}

.swp_rota_email_template {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.swp_rota_email_template label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.swp_rota_email_template textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}

.swp_rota_email_vars {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
}

.swp_rota_email_vars code {
    background: #e9ecef;
    padding: 1px 4px;
    border-radius: 3px;
}

/* =============================================
   AUTO-FILL FEATURE
   ============================================= */

.swp_rota_autofill_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swp_rota_autofill_btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Toolbar Auto-Fill button */
.swp_rota_autofill_toolbar_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swp_rota_autofill_toolbar_btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.swp_rota_autofill_toolbar_btn.swp_rota_autofill_setup {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.swp_rota_autofill_toolbar_btn.swp_rota_autofill_setup:hover {
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.4);
}

/* Auto-Fill Dropdown Menu */
.swp_rota_autofill_menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    overflow: hidden;
}

.swp_rota_autofill_menu_header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.swp_rota_autofill_menu_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.swp_rota_autofill_menu_item:hover {
    background: #f0f3ff;
}

.swp_rota_autofill_menu_item i {
    font-size: 18px;
    color: #667eea;
    width: 24px;
    text-align: center;
}

.swp_rota_autofill_menu_item_info {
    flex: 1;
    min-width: 0;
}

.swp_rota_autofill_menu_item_info strong {
    display: block;
    font-size: 13px;
    color: #333;
}

.swp_rota_autofill_menu_item_info span {
    font-size: 11px;
    color: #888;
}

.swp_rota_autofill_menu_divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.swp_rota_autofill_menu_all {
    background: #f8f0ff;
}

.swp_rota_autofill_menu_all:hover {
    background: #f0e0ff;
}

.swp_rota_autofill_menu_all i {
    color: #764ba2;
}

.swp_rota_autofill_menu_config {
    background: #f8f9fa;
}

.swp_rota_autofill_menu_config i {
    color: #666;
}

.swp_rota_run_autofill_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.swp_rota_run_autofill_btn:hover {
    background: #059669;
}

.swp_rota_autofill_rules {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.swp_rota_autofill_rule {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.swp_rota_autofill_rule_info {
    flex: 1;
    min-width: 0;
}

.swp_rota_autofill_rule_info strong {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.swp_rota_autofill_rule_mode {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    background: #667eea;
    color: #fff;
    border-radius: 10px;
    margin-right: 8px;
}

.swp_rota_autofill_rule_people {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swp_rota_autofill_rule .la-pen,
.swp_rota_autofill_rule .la-trash {
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.swp_rota_autofill_rule .la-pen:hover {
    color: #667eea;
}

.swp_rota_autofill_rule .la-trash:hover {
    color: #dc3545;
}

/* Auto-fill modal */
.swp_rota_autofill_modal_content {
    max-width: 500px;
}

.swp_rota_autofill_form {
    max-height: 60vh;
    overflow-y: auto;
}

.swp_rota_autofill_modes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.swp_rota_autofill_mode {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swp_rota_autofill_mode:hover {
    border-color: #667eea;
    background: #f0f3ff;
}

.swp_rota_autofill_mode.active {
    border-color: #667eea;
    background: #f0f3ff;
}

.swp_rota_autofill_mode input[type="radio"] {
    display: none;
}

.swp_rota_autofill_mode i {
    font-size: 18px;
    margin-right: 8px;
    color: #667eea;
}

.swp_rota_autofill_mode_desc {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    margin-left: 26px;
}

.swp_rota_checkbox_label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    padding: 6px 0;
    cursor: pointer;
}

.swp_rota_checkbox_label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .swp_rota_toolbar {
        flex-direction: column;
    }

    .swp_rota_toolbar button {
        width: 100%;
        justify-content: center;
    }

    .swp_rota_people_list {
        grid-template-columns: 1fr;
    }

    .swp_rota_table {
        font-size: 12px;
    }

    .swp_rota_table th,
    .swp_rota_table td {
        padding: 8px 6px;
    }
}

/* =============================================
   STATS BAR
   ============================================= */

.swp_rota_stats_bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.swp_rota_stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
}

.swp_rota_stat i {
    color: #888;
}

.swp_rota_stat_fill {
    color: #10b981;
}

.swp_rota_stat_fill i {
    color: #10b981;
}

.swp_rota_stat_empty {
    color: #f59e0b;
    font-size: 12px;
}

.swp_rota_stat_today {
    color: #667eea;
    font-weight: 500;
}

.swp_rota_stat_today i {
    color: #667eea;
}

/* =============================================
   VIEW TOGGLE & UNDO/REDO
   ============================================= */

.swp_rota_view_toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #e9ecef;
    color: #495057;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swp_rota_view_toggle:hover {
    background: #dee2e6;
}

.swp_rota_undo_group {
    display: flex;
    gap: 2px;
}

.swp_rota_undo_btn,
.swp_rota_redo_btn {
    padding: 8px 10px;
    background: #e9ecef;
    color: #495057;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swp_rota_undo_btn:first-child {
    border-radius: 6px 0 0 6px;
}

.swp_rota_redo_btn:last-child {
    border-radius: 0 6px 6px 0;
}

.swp_rota_undo_btn:hover:not(.disabled),
.swp_rota_redo_btn:hover:not(.disabled) {
    background: #dee2e6;
}

.swp_rota_undo_btn.disabled,
.swp_rota_redo_btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================
   TODAY HIGHLIGHTING
   ============================================= */

.swp_rota_row_today td {
    background: #eff6ff !important;
    border-top: 2px solid #3b82f6;
    border-bottom: 2px solid #3b82f6;
}

.swp_rota_row_today td:first-child {
    border-left: 2px solid #3b82f6;
}

.swp_rota_row_today td:last-child {
    border-right: 2px solid #3b82f6;
}

.swp_rota_today_badge {
    display: inline-block;
    padding: 2px 6px;
    background: #3b82f6;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 4px;
}

.swp_rota_row_past td {
    opacity: 0.6;
}

/* =============================================
   EMPTY CELL HIGHLIGHTING
   ============================================= */

.swp_rota_td_empty {
    background: #fef3c7 !important;
}

.swp_rota_td_empty:hover {
    background: #fde68a !important;
}

/* =============================================
   PERSON VIEW STYLES
   ============================================= */

.swp_rota_table_person .swp_rota_th_date_col {
    text-align: center;
    min-width: 80px;
    font-size: 11px;
    border-left: 1px solid #dee2e6;
    padding: 8px 6px !important;
}

.swp_rota_table_person .swp_rota_th_date_col .swp_rota_pv_day {
    font-weight: 600;
    color: #374151;
}

.swp_rota_table_person .swp_rota_th_date_col .swp_rota_pv_date {
    color: #6b7280;
    font-weight: 400;
}

.swp_rota_table_person .swp_rota_th_date_col .swp_rota_pv_label {
    font-size: 9px;
    color: #9ca3af;
    font-weight: 400;
    margin-top: 2px;
}

.swp_rota_table_person .swp_rota_th_today {
    background: #eff6ff !important;
    border-bottom: 2px solid #3b82f6 !important;
}

.swp_rota_td_person {
    font-weight: 500;
    white-space: nowrap;
}

.swp_rota_person_dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.swp_rota_td_pv {
    padding: 4px 6px !important;
    vertical-align: middle;
    text-align: center;
    border-left: 1px solid #e5e7eb;
}

.swp_rota_td_pv_empty {
    background: #f8f9fa;
}

.swp_rota_td_pv_today {
    background: #eff6ff !important;
}

.swp_rota_pv_role {
    display: inline-block;
    padding: 2px 6px;
    margin: 1px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
}

.swp_rota_pv_lead {
    background: #dbeafe;
    color: #1e40af;
}

.swp_rota_pv_helper {
    background: #e0e7ff;
    color: #4338ca;
}

/* Highlight toggle button */
.swp_rota_highlight_toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #e9ecef;
    color: #495057;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swp_rota_highlight_toggle:hover {
    background: #dee2e6;
}

.swp_rota_highlight_toggle.active {
    background: #fef3c7;
    color: #92400e;
}

.swp_rota_highlight_toggle.active i {
    color: #f59e0b;
}

/* =============================================
   DROPDOWN MENUS
   ============================================= */

.swp_rota_dropdown_menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    overflow: hidden;
}

.swp_rota_menu_item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 13px;
}

.swp_rota_menu_item:hover {
    background: #f0f3ff;
}

.swp_rota_menu_item i {
    font-size: 16px;
    color: #667eea;
    width: 20px;
    text-align: center;
}

/* =============================================
   COPY ROW BUTTON
   ============================================= */

.swp_rota_td_actions .la-copy {
    color: #10b981;
}

.swp_rota_td_actions .la-copy:hover {
    color: #059669;
}

.swp_rota_checkbox_label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
}

.swp_rota_checkbox_label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Stack rota toolbar on mobile */
@media (max-width: 768px) {
    .swp_rota_toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .swp_rota_toolbar_icons {
        justify-content: space-around;
    }

    .swp_rota_toolbar_dropdowns {
        margin-left: 0;
        justify-content: center;
    }
}

/* =============================================
   PUBLIC ROTA VIEW STYLES
   ============================================= */

/* Public container */
.swp_srota {
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
}

/* Public title */
.swp_public_title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 15px;
    border-bottom: 2px solid #eee;
}

/* Toolbar spacing */
.swp_srota .swp_rota_toolbar {
    flex-shrink: 0;
}

/* Table wrap fills remaining space */
.swp_srota .swp_rota_table_wrap {
    flex: 1;
    max-height: none;
    overflow: auto;
}

/* Remove yellow highlighting for empty cells in public view */
.swp_srota .swp_rota_td_empty {
    background: inherit !important;
}

.swp_srota .swp_rota_td_empty:hover {
    background: inherit !important;
}

/* Dropdown view selector */
.swp_rota_dropdown {
    position: relative;
    display: inline-block;
}

.swp_rota_dropdown_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swp_rota_dropdown_btn:hover {
    background: #f8f9fa;
    border-color: #ced4da;
}

.swp_rota_dropdown_btn .la-angle-down {
    font-size: 12px;
    margin-left: 4px;
    transition: transform 0.2s;
}

.swp_rota_dropdown_menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    max-width: calc(100vw - 40px);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

/* Dropdown positioned from right for items on right side */
.swp_rota_toolbar_dropdowns .swp_rota_dropdown_menu,
.swp_rota_dropdown_menu.swp_dropdown_right {
    left: auto;
    right: 0;
}

/* Filter menu specific - ensure it doesn't go off-screen */
.swp_rota_filter_menu {
    min-width: 200px;
    max-width: 280px;
    right: 0;
    left: auto;
}

.swp_rota_dropdown_menu.show {
    display: block;
}

.swp_rota_dropdown_menu .swp_rota_menu_item.active {
    background: #e8f4fd;
    color: #0066cc;
}

/* Filter dropdown */
.swp_rota_filter_menu {
    min-width: 220px;
    padding: 10px;
}

.swp_rota_filter_section {
    margin-bottom: 12px;
}

.swp_rota_filter_section:last-child {
    margin-bottom: 0;
}

.swp_rota_filter_label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.swp_rota_filter_input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.swp_rota_filter_input:focus {
    outline: none;
    border-color: #3b82f6;
}

.swp_rota_filter_checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.swp_rota_filter_checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.swp_rota_filter_actions {
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.swp_rota_filter_clear {
    width: 100%;
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.swp_rota_filter_clear:hover {
    background: #eee;
}

.swp_rota_filter_divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

.swp_rota_filter_btn {
    width: 100%;
    padding: 10px 12px;
    background: #f0f7ff;
    border: 1px solid #d0e3ff;
    border-radius: 4px;
    font-size: 13px;
    color: #1d4ed8;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.swp_rota_filter_btn:hover {
    background: #dbeafe;
}

.swp_rota_filter_btn i {
    font-size: 14px;
}

.swp_rota_dropdown_btn.active {
    background: #e8f4fd;
    border-color: #3b82f6;
    color: #1d4ed8;
}

/* Filter summary bar */
.swp_rota_filter_summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
    margin-bottom: 10px;
}

.swp_rota_filter_summary i:first-child {
    color: #f59e0b;
}

.swp_rota_filter_summary_clear {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.swp_rota_filter_summary_clear:hover {
    opacity: 1;
}

/* Scroll highlight flash */
@keyframes swp_rota_flash {
    0% {
        background-color: #fef08a;
    }

    100% {
        background-color: transparent;
    }
}

.swp_rota_highlight_flash {
    animation: swp_rota_flash 1.5s ease-out;
}

.swp_rota_table tr.swp_rota_highlight_flash td {
    animation: swp_rota_flash 1.5s ease-out;
}

/* Person view sticky first column */
.swp_rota_th_person_sticky,
.swp_rota_td_person_sticky {
    position: sticky;
    left: 0;
    z-index: 15;
    background: #f8f9fa;
    border-right: 2px solid #dee2e6 !important;
    min-width: 140px;
    font-weight: 500;
}

.swp_rota_td_person_sticky {
    background: #fff;
}

.swp_rota_table tbody tr:nth-child(even) .swp_rota_td_person_sticky {
    background: #f8fafc;
}

.swp_rota_table tbody tr:hover .swp_rota_td_person_sticky {
    background: #eef2ff !important;
}

/* Top-left corner cell needs highest z-index */
.swp_rota_th_person_sticky {
    z-index: 25;
}

/* =============================================
   PERSON VIEW - Schedule Layout
   ============================================= */

.swp_rota_list_wrap {
    flex: 1;
    overflow: auto;
    padding: 10px 0;
}

.swp_rota_person_card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px 18px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}

.swp_rota_person_card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.swp_rota_person_card_name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.swp_rota_person_card_schedule {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.swp_rota_person_schedule_row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.swp_rota_person_schedule_row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.swp_rota_person_schedule_row:first-child {
    padding-top: 0;
}

.swp_rota_schedule_date {
    width: 130px;
    min-width: 130px;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.swp_rota_schedule_roles {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.swp_rota_schedule_role_lead {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.swp_rota_schedule_role_helper {
    display: inline-block;
    background: #f3e8ff;
    color: #7c3aed;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.swp_rota_schedule_role_team {
    display: inline-block;
    background: #fce7f3;
    color: #be185d;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.swp_rota_schedule_role {
    display: inline-block;
    background: #e5e7eb;
    color: #374151;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.swp_rota_schedule_today {
    background: linear-gradient(90deg, #eff6ff 0%, transparent 100%);
    margin: 0 -18px;
    padding-left: 18px;
    padding-right: 18px;
    border-radius: 4px;
}

.swp_rota_schedule_today .swp_rota_schedule_date {
    color: #1d4ed8;
    font-weight: 600;
}

.swp_rota_schedule_past {
    opacity: 0.5;
}

.swp_rota_person_card_empty {
    color: #999;
    font-style: italic;
    font-size: 13px;
}

/* Legacy tag styles - keep for print compatibility */
.swp_rota_person_card_dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.swp_rota_person_tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #dbeafe;
    border-radius: 6px;
    font-size: 12px;
}

.swp_rota_person_tag.swp_rota_tag_helper {
    background: #e0e7ff;
}

.swp_rota_person_tag.swp_rota_tag_today {
    background: #3b82f6;
    color: #fff;
}

.swp_rota_person_tag.swp_rota_tag_past {
    opacity: 0.5;
}

.swp_rota_tag_date {
    font-weight: 600;
}

.swp_rota_tag_role {
    color: #555;
}

/* =============================================
   DATE VIEW - Card Layout
   ============================================= */

.swp_rota_date_card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px 18px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}

.swp_rota_date_card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.swp_rota_date_card_today {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 100%);
}

.swp_rota_date_card_past {
    opacity: 0.6;
}

.swp_rota_date_card_header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.swp_rota_date_card_date {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.swp_rota_date_card_label {
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    padding: 2px 10px;
    border-radius: 12px;
}

.swp_rota_date_card_roles {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.swp_rota_date_card_role {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.swp_rota_date_card_role:last-child {
    border-bottom: none;
}

.swp_rota_date_card_role_name {
    width: 140px;
    min-width: 140px;
    font-weight: 500;
    color: #666;
    font-size: 13px;
    padding-top: 2px;
}

.swp_rota_date_card_role_value {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.swp_rota_date_card_person {
    display: inline-block;
    background: #e8f4fd;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.swp_rota_date_card_helper {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
}

.swp_rota_date_card_team {
    display: inline-block;
    background: #fce7f3;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #be185d;
}

.swp_rota_date_card_text {
    font-size: 13px;
    color: #333;
}

.swp_rota_date_card_empty {
    color: #ccc;
    font-size: 13px;
}