/* ===================================================== */
    /*                  CORE LAYOUT (UI)                     */
    /* ===================================================== */
    * { box-sizing: border-box; }
    
    body { 
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
        padding: 10px; 
        margin: 0;
        background-color: #f4f6f8;
        color: #333; 
    }
	
	/* New Style for Worker Star */
.worker-star-btn {
    cursor: pointer;
    font-size: 1.2rem;
    color: #ccc;
    margin-right: 5px;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.worker-star-btn.active {
    color: #f39c12; /* Gold */
}
.worker-star-btn:hover {
    background: none;
    color: #888;
}
    
    .container { 
        max-width: 900px; 
        margin: 0 auto; 
        background: white; 
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    h1 { 
        font-size: 1.5rem; 
        border-bottom: 3px solid #4a90e2; 
        padding-bottom: 10px; 
        margin-bottom: 20px; 
        color: #2c3e50;
    }
    
    /* ===================================================== */
    /*                  VERTICAL LIST CSS                    */
    /* ===================================================== */
    .avail-grid {
        display: flex;
        flex-direction: column; /* Stack items vertically */
        gap: 3px;               /* Space between items */
        width: 100%;            /* Fill the cell */
    }
    
    .avail-pill {
        font-size: 11px;
        background: #fff;
        border: 1px solid #ddd;
        padding: 5px 8px;       /* Bigger click area */
        border-radius: 4px;
        cursor: pointer;
        display: flex;          /* Use flex to align checkbox and text */
        align-items: center;    /* Center vertically */
        user-select: none;
        width: 100%;            /* Make it look like a list item */
        transition: background 0.1s;
    }

    .avail-pill:hover {
        background-color: #f0f0f0;
        border-color: #ccc;
    }

    /* Style for Selected State */
    .avail-pill.active {
        background-color: #e8f5e9; /* Light Green */
        border-color: #28a745;
        color: #155724;
        font-weight: 600;
    }

    .avail-pill input {
        margin-right: 8px;
        display: inline-block; 
        pointer-events: none; /* Clicks go through to the label */
    }
    
    /* ===================================================== */
    /*                  ACCORDION                            */
    /* ===================================================== */
    h2.accordion-header { 
        font-size: 1.1rem; 
        background: #f8f9fa;
        padding: 10px;
        border-radius: 4px;
        cursor: pointer; 
        user-select: none; 
        margin-top: 10px;
        margin-bottom: 5px;
        border: 1px solid #e1e4e8;
        display: flex;
        justify-content: space-between;
    }
    
    .collapsible { 
        display: none; 
        margin-bottom: 15px; 
        padding: 10px; 
        border: 1px solid #f0f0f0;
        border-top: none;
        border-radius: 0 0 5px 5px;
    }

  /* ===================================================== */
/*                  PRIORITY STARS                       */
/* ===================================================== */
.role-priority-btn {
    cursor: pointer;
    font-size: 1.4rem;       /* Increased from 1.2rem for better visibility */
    color: #888;             /* Changed from #ccc to #888 (Darker Gray) */
    margin-right: 8px;       /* More space between star and name */
    line-height: 1;
    user-select: none;
    display: inline-block;   /* Ensures it takes up space */
    transition: color 0.2s;
}
.role-priority-btn:hover {
    color: #555;             /* Darker on hover */
}
.role-priority-btn.high {
    color: #f39c12;          /* Orange/Gold stays the same */
}

    /* In the Schedule View */
    .priority-indicator {
        color: #f39c12;
        font-size: 0.9em;
        margin-right: 2px;
        vertical-align: middle;
    }

    /* ===================================================== */
    /*                  VIEW TABS                            */
    /* ===================================================== */
    .view-tabs {
        display: flex;
        margin-bottom: 20px;
        border-bottom: 2px solid #ddd;
    }
    .view-tab {
        flex: 1;
        padding: 12px;
        text-align: center;
        background: #f1f1f1;
        cursor: pointer;
        font-weight: bold;
        color: #555;
        border: 1px solid #ddd;
        border-bottom: none;
        border-radius: 8px 8px 0 0;
        margin-right: 5px;
    }
    .view-tab:last-child { margin-right: 0; }
    .view-tab.active {
        background: white;
        color: #4a90e2;
        border-top: 3px solid #4a90e2;
        border-bottom: 2px solid white; 
        margin-bottom: -2px;
    }

    /* ===================================================== */
    /*                  FORMS & INPUTS                       */
    /* ===================================================== */
    .input-group { 
        background: #fff; 
        padding: 10px; 
        margin-bottom: 10px; 
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
        border: 1px dashed #ccc;
        border-radius: 4px;
    }
	.input-group input, .input-group select {
    flex: 1 1 150px; /* Allow shrinking but prefer 150px width */
}

    label { font-weight: 600; font-size: 0.85rem; }
    
    input[type="text"], input[type="date"], select { 
        padding: 8px; 
        font-size: 14px; 
        border: 1px solid #ccc; 
        border-radius: 4px; 
        flex: 1; 
        min-width: 120px;
    }

    button { 
        background-color: #4a90e2; 
        color: white; 
        border: none; 
        cursor: pointer; 
        padding: 8px 15px; 
        border-radius: 4px; 
        font-size: 14px;
        white-space: nowrap;
    }
    button:hover { background-color: #357abd; }
    button.deleteBtn { background-color: #e74c3c; padding: 4px 8px; font-size: 12px; }
    button.moveUp, button.moveDown { background-color: #95a5a6; padding: 4px 8px; font-size: 12px; }

    /* ===================================================== */
    /*      SPECIAL CONTROLS (FULL WIDTH / GENERATE)         */
    /* ===================================================== */
    .special-schedule-controls {
        display: flex;
        flex-direction: column !important; /* Stack Line 1 on top of Line 2 */
        width: 100%;                       /* Force full width */
        gap: 10px;                         /* Vertical gap between lines */
        padding: 0 !important;             /* Remove extra padding if any */
        border: none !important;           /* Clean look */
    }

    .controls-row-inputs {
        display: flex;
        flex-direction: row;    /* Always horizontal */
        width: 100%;            /* Fill the parent width */
        align-items: center;
        gap: 8px;               /* Space between items */
    }

    .controls-row-inputs label {
        flex: 0 0 auto;         /* Do not grow, do not shrink */
        white-space: nowrap;
    }

    .controls-row-inputs input, 
    .controls-row-inputs select {
        flex: 1;                /* Grow to fill space */
        width: 100%;            /* Force width */
        margin: 0 !important;
    }

    .controls-row-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

/* When the row has exactly 3 buttons → no wrapping */
.controls-row-buttons:has(button:nth-child(3):last-child) {
    flex-wrap: nowrap;
}

/* When the row has 4 buttons → allow wrapping */
.controls-row-buttons:has(button:nth-child(4)) {
    flex-wrap: wrap;
}

.controls-row-buttons button {
    flex: 1;
    min-width: 0;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


    /* ===================================================== */
    /*                  TABLES                               */
    /* ===================================================== */
    .table-wrapper {
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        margin-top: 10px;
    }

    table { 
        border-collapse: collapse; 
        width: 100%; 
        min-width: 100%; 
    }
    
    tr:nth-child(even) { background-color: #f9f9f9; }
    
    th, td { 
        border: 1px solid #dee2e6; 
        padding: 8px; 
        text-align: left; 
        font-size: 13px; 
        vertical-align: top; 
        white-space: normal; 
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    th { background-color: #f1f8ff; font-weight: 600; }

    /* ===================================================== */
    /*                  DATA CONTROLS                        */
    /* ===================================================== */
    .data-controls { 
        display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; 
        background: #eef2f5; padding: 10px; border-radius: 5px; 
    }
    .data-controls button { flex: 1; min-width: 100px; font-size: 12px; }
    
    .status-badge { 
        width: 100%; text-align: center; margin-top: 5px;
        font-size: 12px; font-weight: bold; padding: 5px; border-radius: 4px; 
    }
    .status-saved { background-color: #d4edda; color: #222; }
    .status-unsaved { background-color: #f8d7da; color: #222; }

    .role-options-container { display: flex; flex-wrap: wrap; gap: 5px; min-width: 150px; }
    .role-option-label { 
        background: #f1f1f1; padding: 4px 8px; border-radius: 12px; 
        font-size: 11px; cursor: pointer; border: 1px solid #ddd; 
        white-space: nowrap;
    }
    .role-option-label input { margin-right: 4px; vertical-align: middle; }

    .role-day-pill {
        display: inline-block; font-size: 11px; background: #e8f0fe; color: #1a73e8;
        border: 1px solid #b3d7ff; border-radius: 4px; padding: 2px 6px; margin: 2px; cursor: pointer;
    }
    .role-day-pill input { margin-right: 4px; }

    /* ===================================================== */
    /*                  MODALS & TOASTS                      */
    /* ===================================================== */
    #startupOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; display: flex; justify-content: center; align-items: center; padding: 20px; }
    .startup-box { background: white; padding: 20px; border-radius: 8px; text-align: center; width: 100%; max-width: 400px; }
    .startup-btn { margin: 8px 0; padding: 12px; width: 100%; }

    .modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.4); }
    .modal-content { background-color: #fefefe; padding: 20px; width: 90%; max-width: 400px; border-radius: 5px; }
    .volunteer-option { padding: 10px; border-bottom: 1px solid #eee; }

    .toast-box {
        position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
        background-color: #333; color: #fff; padding: 12px 25px; border-radius: 50px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2); font-size: 14px; opacity: 0; visibility: hidden;
        transition: opacity 0.3s, bottom 0.3s; z-index: 3000;
    }
    .toast-box.show { opacity: 1; visibility: visible; bottom: 50px; }
    .toast-success { background-color: #27ae60; }
    .toast-error   { background-color: #e74c3c; }

    .modal-checkbox-grid { display: flex; flex-wrap: wrap; gap: 10px; background: #f9f9f9; padding: 10px; border: 1px solid #eee; border-radius: 4px; max-height: 150px; overflow-y: auto; }
    .modal-checkbox-grid label { font-weight: normal; font-size: 13px; background: white; padding: 5px 8px; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; display: flex; align-items: center; }
    .modal-checkbox-grid input { margin-right: 6px; }

    /* ===================================================== */
    /*                  AGENDA LAYOUT (SCREEN)               */
    /* ===================================================== */
    
    .month-section { margin-bottom: 30px; }
    
    .month-header {
        font-size: 20pt;
        font-weight: bold;
        text-transform: uppercase;
        border-bottom: 2px solid #333;
        margin-bottom: 10px;
        padding-top: 10px;
        color: #000;
    }

    .agenda-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 0;
    }

    .agenda-table th {
        text-align: left;
        background: #eee;
        padding: 5px 10px;
        border-bottom: 1px solid #999;
        font-size: 10pt;
        font-weight: bold;
        color: #000;
    }
    .th-date { width: 12%; }

    .agenda-table td {
        padding: 6px 5px;
        border-bottom: 1px solid #ddd;
        vertical-align: top;
        color: #000;
    }
    
    .date-cell {
        text-align: center;
        background: #fafafa;
        border-right: 1px solid #eee;
    }
    .date-day { font-size: 1.4em; font-weight: bold; line-height: 1; color: #000; }
    .date-weekday { font-size: 0.8em; color: #444; font-weight: normal; }
    .event-label { 
        margin-top: 4px; 
        font-size: 0.7em; 
        background: #e0e0e0; 
        padding: 2px 4px; 
        border-radius: 3px; 
        display: inline-block;
        color: #333;
        font-weight: normal;
    }

    /* Grid for Roles (Two Columns Default) */
    .role-list-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Two columns for A4 Vertical */
        column-gap: 15px;
        row-gap: 2px;
    }

    .role-item {
        display: flex;
        align-items: baseline;
        font-size: 9.5pt;
        line-height: 1.3;
        border-bottom: 1px dotted #f0f0f0;
    }

    .role-label {
        font-weight: 700; 
        color: #000 !important; 
        margin-right: 6px;
        white-space: nowrap;
        font-size: 0.9em;
    }

    .role-value {
        color: #000;
        font-weight: normal;
    }

    .assignee-clickable {
        cursor: pointer;
    }
    .assignee-clickable:hover {
        color: blue;
        text-decoration: underline;
    }

    /* ===================================================== */
    /*                  MOBILE TWEAKS                        */
    /* ===================================================== */
    @media (max-width: 600px) {

        /* 1. Force the grid to be just 1 Column */
        .role-list-grid {
            grid-template-columns: 1fr !important;
            row-gap: 15px;
        }

        /* 2. Stack the Header (Label) on top of the Names */
        .role-item {
            display: block !important;
            border-bottom: 1px dotted #eee;
            padding-bottom: 8px;
        }

        /* 3. Style the Header */
        .role-label {
            display: block;
            margin-bottom: 4px;
            color: #000 !important;
            font-weight: 800;
            font-size: 0.8rem;
        }

        /* 4. Stack names */
        .role-value {
            font-size: 0;
            display: block;
        }

        /* 5. Style the individual Names */
.assignee-clickable {
    font-size: 14px;
    display: inline-block; /* Changed from block to inline-block */
    margin-right: 5px;     /* Adds the missing space between names */
    margin-bottom: 3px;
    color: #333;
    font-weight: 500;
}
        
        /* 6. Mobile Overrides for Schedule Controls */
        .special-schedule-controls {
            align-items: stretch;
        }
        
        .controls-row-inputs, 
        .controls-row-buttons {
            flex-direction: row !important; /* Keep horizontal on phone */
        }

        /* Make touch targets slightly taller */
        .controls-row-inputs input, 
        .controls-row-inputs select, 
        .controls-row-buttons button {
            height: 42px; 
        }



        #rolesTable th:nth-child(1), #rolesTable td:nth-child(1) { width: 30%; } /* Name */
        #rolesTable th:nth-child(2), #rolesTable td:nth-child(2) { width: 15%; } /* Count */
    }

    /* ===================================================== */
    /*                  PRINT SPECIFIC OVERRIDES             */
    /* ===================================================== */
    @media print {
        @page { 
            size: A4 portrait; 
            margin: 0; 
        }
        
        body { 
            background: white; 
			margin: 1cm;
            padding: 0; 
            -webkit-print-color-adjust: exact; 
        }

        /* Hide App UI */
        .container { max-width: 100%; width: 100%; box-shadow: none; border: none; padding: 0; }
        .no-print, .data-controls, h1, h2.accordion-header, .view-tabs, .collapsible, .input-group, #setupView { 
            display: none !important; 
        }
        #scheduleContainer { display: block !important; }

        /* Page Breaking Logic */
        .month-section { page-break-after: always; }
        .month-section:last-child { page-break-after: auto; }
        
        /* Ensure Table doesn't break internally awkwardly */
        .agenda-table tr { page-break-inside: avoid; }

        /* Color Corrections for Print */
        .role-label { color: #000 !important; }
        .role-value { color: #000 !important; font-weight: normal !important; }
        
        /* Zebra Striping */
        .agenda-table tr:nth-child(even) td {
            background-color: #f4f4f4 !important;
            -webkit-print-color-adjust: exact;
        }
    }
	
	/* ===================================================== */
/*   MOBILE CARDS FOR VOLUNTEERS (Add to bottom of CSS)  */
/* ===================================================== */
@media (max-width: 600px) {

    /* 1. Reset the Table to be a Block */
    #workersTable, #workersTable tbody, #workersTable tr, #workersTable td {
        display: block;
        width: 100%;
    }

    /* 2. Hide the Main Table Header */
    #workersTable thead {
        display: none;
    }

    /* 3. Style the Rows as "Cards" */
    #workersTable tr {
        background: #fff;
        margin-bottom: 15px;
        border: 1px solid #e1e4e8;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        padding: 10px;
    }

    /* 4. Style the Cells */
    #workersTable td {
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #eee;
        text-align: left;
    }
    
    #workersTable td:last-child {
        border-bottom: none;
    }

    /* 5. The Name Cell (Top of Card) */
    #workersTable td:first-child {
        background-color: #f8f9fa;
        margin: -10px -10px 10px -10px; /* Stretch to edges */
        padding: 12px 15px;
        border-radius: 8px 8px 0 0;
        border-bottom: 1px solid #e1e4e8;
        font-weight: bold;
        font-size: 1.1em;
    }

    /* 6. Inject the Meeting Label (e.g. "Midweek:") */
    #workersTable td[data-label]::before {
        content: attr(data-label); /* Grabs the text from JS */
        display: block;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #888;
        font-weight: 700;
        margin-bottom: 6px;
        letter-spacing: 0.5px;
    }

    /* 7. Make the Delete Button Full Width */
    #workersTable td:last-child button {
        width: 100%;
        padding: 10px;
        margin-top: 5px;
        background-color: #fff;
        color: #e74c3c;
        border: 1px solid #e74c3c;
    }
}

.data-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.data-controls button {
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s, transform 0.1s;
}



.data-controls button:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

/* --- NEW: Better Mobile Controls Layout --- */
@media (max-width: 600px) {
    .data-controls {
        display: grid !important;     /* Force Grid on mobile */
        grid-template-columns: 1fr 1fr; /* 2 Equal Columns */
        gap: 8px;
    }

    /* Make the buttons big and easy to tap */
    .data-controls button {
        width: 100%;
        height: 40px; 
    }

    /* Force the status badge to take the full bottom row */
    #statusBadge {
        grid-column: 1 / -1; /* Span all columns */
        margin-top: 0;
    }
}

/* --- NEW: Unsaved Header State --- */
h1.unsaved-alert {
    background-color: #fee2e2; /* Soft Warning Red Background */
    color: #c0392b;            /* Dark Red Text */
    border-bottom-color: #c0392b; /* Change the underline color */
    padding: 10px;             /* Add padding so background looks nice */
    border-radius: 6px;
    transition: all 0.3s ease;
}

/* Optional: Make the Save button pulse when unsaved */
body.is-unsaved .btn-save {
    background-color: #e74c3c;
    color: white;
    font-weight: bold;
    animation: pulse-save 2s infinite;
}

@keyframes pulse-save {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}


/* ===================================================== */
    /*                  LOGIN SCREEN (New)                   */
    /* ===================================================== */
    #loginOverlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #f4f6f8; /* Matches body background */
        z-index: 9999; /* Higher than everything else */
        display: flex;
        justify-content: center;
        align-items: center;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }

    .login-card {
        background: white;
        padding: 40px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        width: 100%;
        max-width: 380px;
        text-align: center;
        border: 1px solid #e1e4e8;
    }

    .login-title {
        margin: 0 0 25px 0;
        color: #2c3e50;
        font-size: 1.6rem;
        font-weight: 600;
        border-bottom: 2px solid #4a90e2;
        display: inline-block;
        padding-bottom: 10px;
    }

    .login-input-container {
        margin-bottom: 15px;
        text-align: left;
    }

    .login-input {
        width: 100%;
        padding: 12px 15px;
        font-size: 16px;
        border: 1px solid #ccc;
        border-radius: 6px;
        outline: none;
        transition: border-color 0.3s;
    }

    .login-input:focus {
        border-color: #4a90e2;
        box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    }

    .login-options {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
        font-size: 13px;
        color: #555;
    }

    .login-checkbox-label {
        display: flex;
        align-items: center;
        cursor: pointer;
        user-select: none;
    }

    .login-checkbox-label input {
        margin-right: 6px;
        cursor: pointer;
    }

    .login-btn {
        width: 100%;
        padding: 12px;
        background-color: #4a90e2;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .login-btn:hover {
        background-color: #357abd;
    }

    .login-error {
        color: #e74c3c;
        font-size: 13px;
        margin-top: 15px;
        display: none;
        animation: shake 0.3s;
    }

    @keyframes shake {
        0% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        50% { transform: translateX(5px); }
        75% { transform: translateX(-5px); }
        100% { transform: translateX(0); }
    }
	
	/* Double Assignment Warning */
.double-duty-alert {
    color: #c0392b !important; /* Dark Red */
    background-color: #fadbd8; /* Light Pink */
    font-weight: bold;
    border-radius: 4px;
    padding: 0 4px;
    border: 1px solid #c0392b;
}

/* ===================================================== */
/*     LARGE SYMBOL-ONLY BUTTONS (SIMPLIFIED)           */
/* ===================================================== */

/* ALL SYMBOL BUTTONS */
.data-controls button,
.controls-row-buttons button, 
.schedule-buttons-row button{
    /* Layout */
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    
    /* Size */
    height: 44px !important;
    min-height: 44px !important;
    flex: 1 !important;            /* Fill available width equally */
    width: auto !important;        /* Don't force square */
    min-width: 44px !important;
    
    /* Spacing */
    padding: 0 !important;
    margin: 0 !important;
    
    /* Large Symbols */
    font-size: 1.8rem !important;
    line-height: 1 !important;
    
    /* Appearance */
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    
    /* Transitions */
    transition: all 0.2s ease !important;
}



#generate        { background-color: #4a90e2 !important; }
#undoBtn         { background-color: #f39c12 !important; }
#printSchedule   { background-color: #7f8c8d !important; }
#waNextBtn       { background-color: #25D366 !important; }

/* Hover effects */
.data-controls button:hover,
.controls-row-buttons button:hover {
    filter: brightness(0.9) !important;
    transform: translateY(-2px) !important;
}

/* Active state */
.data-controls button:active,
.controls-row-buttons button:active {
    transform: translateY(0) !important;
}

/* Mobile - even larger */
@media (max-width: 600px) {
    .data-controls button,
    .controls-row-buttons button,
	.schedule-buttons-row button {
        height: 52px !important;
        width: auto !important;
        min-width: 52px !important;
        font-size: 2.2rem !important;
        border-radius: 10px !important;
    }
    
    /* Data controls grid layout */
    .data-controls {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
        justify-items: center !important;
    }
    
    /* Schedule buttons layout */
    .controls-row-buttons {
        display: flex !important;
        justify-content: space-between !important;
        gap: 10px !important;
        width: 100% !important;
    }
/* NEW: This spaces 3 buttons evenly, and 4 buttons evenly */
.schedule-buttons-row {
    display: flex !important;
    justify-content: space-between !important; /* Push buttons to edges */
    gap: 10px !important;
    width: 100% !important;
}
}

/* Wrapper for the split schedule controls */
/* Wrapper for the split schedule controls */
#scheduleToolbar {
    display: flex;
    flex-direction: column; 
    gap: 10px;              
    margin-bottom: 20px;
    width: 100%;
    
    /* --- NEW: Match the "Setup" container look --- */
    background: #eef2f5; 
    padding: 10px; 
    border-radius: 5px; 
}

/* Row 1: Inputs */
.schedule-inputs-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* Make inputs grow to fill the line and match button height */
.schedule-inputs-row input, 
.schedule-inputs-row select {
    flex: 1;
    height: 44px; /* Matches your button height */
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 14px;
    box-sizing: border-box;
    margin: 0; /* Reset margins */
}

/* Row 2: Buttons */
.schedule-buttons-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.schedule-buttons-row button {
    flex: 1; /* Buttons share width equally */
    /* (Your existing button styles will handle the colors/icons) */
}

.schedule-buttons-row button {
    /* Flex removed. Sizing is now handled by "ALL SYMBOL BUTTONS" block */
    background-color: #999; /* Default fallback color if ID not matched */
}

/* Name input in Add Volunteer modal - larger and blue on focus */
/* ── Add Volunteer Modal ─────────────────────────── */
#addWorkerModal {
    z-index: 2000;
}
#addWorkerModal .modal-content {
    max-width: 640px;
    width: 95%;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 8px;
}

.add-worker-header {
    background: #4a90e2;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}
.add-worker-header h3 {
    margin: 0;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.add-worker-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

.add-worker-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #444;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.add-worker-hint {
    font-size: 12px;
    color: #888;
    margin: 0 0 12px;
}

.add-worker-footer {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
}
.add-worker-btn-cancel {
    flex: 1;
    background: #95a5a6;
    padding: 10px;
}
.add-worker-btn-save {
    flex: 2;
    background: #27ae60;
    padding: 10px;
    font-weight: bold;
}

#newWorkerName {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-bottom: 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
#newWorkerName:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74,144,226,0.15);
    outline: none;
}

/* Assignment table inside add volunteer modal */
#newWorkerAvailContainer table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}
#newWorkerAvailContainer thead th {
    background: #f0f5ff;
    padding: 8px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #4a90e2;
}
#newWorkerAvailContainer tbody tr:nth-child(even) {
    background: #f9fbff;
}
#newWorkerAvailContainer tbody td {
    padding: 7px 6px;
    border-bottom: 1px solid #f0f0f0;
}
#newWorkerAvailContainer input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#newWorkerAvailContainer {
    max-height: none;
}

/* Make mapping modal responsive on small screens */
.mapping-content {
    width: 90%;
    max-width: 600px;
}
#mappingModal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000; display: none;
    justify-content: center; align-items: center;
}
.mapping-content {
    background: white; width: 600px; max-height: 80vh;
    padding: 20px; border-radius: 8px; display: flex; flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.mapping-list {
    flex: 1; overflow-y: auto; margin: 15px 0; border: 1px solid #eee;
}
.mapping-row {
    display: flex; align-items: center; padding: 10px; border-bottom: 1px solid #eee;
}
.mapping-row:nth-child(even) { background: #f9f9f9; }
.mapping-label { flex: 1; font-weight: bold; font-size: 14px; }
.mapping-select { flex: 1; padding: 5px; }
.mapping-actions { text-align: right; margin-top: 10px; }

/* ===================================================== */
/*             SETUP TOOLBAR (3-BUTTON ROW)             */
/* ===================================================== */
.setup-toolbar-row {
    display: flex;         /* Sits items horizontally */
    width: 100%;           /* Fills the full width of the container */
    gap: 10px;             /* Space between buttons */
    margin-bottom: 20px;
    background: #eef2f5;   /* Matches your schedule toolbar background */
    padding: 10px; 
    border-radius: 5px;
    box-sizing: border-box;
}

.setup-toolbar-row button {
    flex: 1;               /* Each button grows to fill equal space */
    height: 48px;          /* Comfortable height for touch/mouse */
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.8rem;     /* Large symbol size */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.2s, transform 0.1s;
}

/* Specific Colors from your Script Logic */
#btnShare { background-color: #27ae60 !important; }
#btnPaste { background-color: #8e44ad !important; }
#btnReset { background-color: #e74c3c !important; }

/* Interactive effects */
.setup-toolbar-row button:hover {
    filter: brightness(0.9);
}

.setup-toolbar-row button:active {
    transform: translateY(2px);
}

/* Mobile specific: Makes buttons slightly taller for easier tapping */
@media (max-width: 600px) {
    .setup-toolbar-row {
        gap: 8px;
        padding: 8px;
    }
    .setup-toolbar-row button {
        height: 52px;
        font-size: 2.1rem;
    }
}

/* ===================================================== */
/*                USER GUIDE / INSTRUCTIONS              */
/* ===================================================== */
.guide-container {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
    line-height: 1.6;
    color: #333;
}

.guide-section-header {
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    margin-top: 20px;
    padding-bottom: 5px;
}

.guide-box {
    background: #f0f7ff;
    border: 1px solid #4a90e2;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.guide-box-header {
    color: #2c3e50;
    margin-top: 0;
    border-bottom: 1px solid #4a90e2;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.guide-list {
    padding-left: 20px;
    margin-top: 5px;
}

.guide-list-none {
    list-style: none;
    padding-left: 0;
}

.guide-item-flex {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
}

.guide-icon-box {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 1.2rem;
    margin-right: 12px;
    flex-shrink: 0;
    color: white;
    font-weight: bold;
}

/* Specific guide button colors */
.guide-icon-paste { background: #8e44ad; }
.guide-icon-share { background: #27ae60; }
.guide-icon-reset { background: #7f8c8d; }
.guide-icon-gen   { background: #4a90e2; font-size: 1rem; }
.guide-icon-print { background: #7f8c8d; font-size: 1rem; }
.guide-icon-wa    { background: #25D366; font-size: 1rem; }

.guide-note {
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
}

.guide-alert-text {
    color: #c0392b;
    font-weight: bold;
    background: #fee2e2;
    padding: 0 4px;
}

.warning strong {
    color: #000; /* Makes the bold text pitch black for higher contrast */
    margin-right: 3px;
}

/* Accordion Link Headers */
.guide-link {
    display: block;
    width: 100%;
    text-align: left;
    background: #f1f5f9;
    color: #2c3e50;
    padding: 15px;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.guide-link:hover { background: #e2e8f0; }

/* The "Nice Box" Style (Sections 1 & 3) */
.nice-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #eef0f2;
    margin-top: 10px;
}


/* Ensure the overlay covers the entire screen */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Dim the background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999; /* Higher than all other overlays */
}

/* Style the box inside the overlay */
.modal-box {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    border-top: 5px solid #e74c3c; /* Red highlight for deletion */
}

/* The warning message text */
.modal-message {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Layout for the buttons */
.modal-buttons {
    display: flex;
    gap: 12px;
}

/* Base button style */
.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-btn:active {
    opacity: 0.7;
}

/* Grey Cancel Button */
.btn-cancel {
    background-color: #95a5a6;
    color: white;
}

/* Red Delete Button */
.btn-ok {
    background-color: #e74c3c;
    color: white;
}

/* The background overlay */
.modal, .modal-overlay {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* No display: flex here so we don't override your display: none */
}

/* The actual white box inside the modals - Centered Horizontally and Vertically */
.modal-content, .modal-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* This performs the centering */
    
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}

/* Grid for the Volunteer Modal */
.modal-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 5px;
}

/* General button containers inside modals */
.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.modal-content, .modal-box {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: translate(-50%, -50%) !important;
}







/* ===================================================== */
/*                  PEOPLE PANEL                         */
/* ===================================================== */

#peopleView {
    width: 100%;
}

#peopleView .accordion-header {
    font-size: 1.1rem;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    margin-top: 10px;
    margin-bottom: 5px;
    border: 1px solid #e1e4e8;
    display: flex;
    justify-content: space-between;
}

#roleAssignList {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
}

/* Make chevron, star, and X button small and inline */
#workersTable td:first-child > div {
    gap: 4px !important;
}

/* Chevron (arrow) */
#workersTable td:first-child span:first-child {
    font-size: 10px !important;
    width: 16px !important;
}

/* Star button */
.worker-star-btn {
    font-size: 14px !important;
    width: 20px !important;
    padding: 0 !important;
}

/* X button */
#workersTable .deleteBtn {
    width: 26px !important;
    min-width: 26px !important;
    height: 24px !important;
    padding: 0 !important;
    font-size: 11px !important;
    line-height: 1 !important;
}
/* ── Volunteer detail row inner table: override responsive block rules ── */
#workersTable tr.worker-detail-row {
    background: #f8fbff !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    margin-top: -15px !important;
    padding: 0 10px 10px 10px !important;
    box-shadow: none !important;
}

#workersTable tr.worker-detail-row td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: none !important;
    padding: 0 0 0 28px !important;
    background: transparent !important;
}

/* Inner assignment table: restore normal table layout, no lines anywhere */
#workersTable tr.worker-detail-row td table {
    display: table !important;
    width: calc(100% - 4px) !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border: none !important;
    font-size: 13px !important;
    margin-top: 8px !important;
}

#workersTable tr.worker-detail-row td table thead,
#workersTable tr.worker-detail-row td table tbody {
    display: table-header-group !important;
}

#workersTable tr.worker-detail-row td table tbody {
    display: table-row-group !important;
}

#workersTable tr.worker-detail-row td table tr {
    display: table-row !important;
    width: auto !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
}

#workersTable tr.worker-detail-row td table th,
#workersTable tr.worker-detail-row td table td {
    display: table-cell !important;
    width: auto !important;
    padding: 6px 10px !important;
    text-align: center !important;
    border: none !important;
    background: transparent !important;
}

#workersTable tr.worker-detail-row td table th:first-child,
#workersTable tr.worker-detail-row td table td:first-child {
    text-align: left !important;
    padding: 6px 8px 6px 0 !important;
    font-weight: 500 !important;
    background: transparent !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 13px !important;
    width: auto !important;
}

#workersTable tr.worker-detail-row td table th {
    background: #eef4ff !important;
    font-weight: 600 !important;
    border: none !important;
}

#workersTable tr.worker-detail-row td table th:first-child {
    background: #eef4ff !important;
    font-weight: 600 !important;
    font-size: 12px !important;
}