* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #adafb1; /* slightly darker gray outer shell */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: #000000;
    color: #ffffff;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #000; /* Make the header bottom border black */
}

header h1.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

header h1.brand .brand-text {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.3px;
}

header .brand-logo {
    height: 44px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: block;
}

header h1.brand .heartbeat {
    margin-left: 0;
}

@media (max-width: 520px) {
    header .brand-logo {
        height: 36px;
        max-width: 190px;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

h1 {
    margin: 0;
    font-size: 2em;
}

/* Fun heartbeat animation next to title */
.heartbeat {
    display: inline-block;
    margin-left: 10px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    color: #cc1b1b; /* Match accent red used across app */
    animation: heartbeat 1.2s infinite ease-in-out;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    20% { transform: scale(1.15); }
    40% { transform: scale(1); }
    60% { transform: scale(1.25); }
    80% { transform: scale(1); }
    100% { transform: scale(1); }
}

nav {
    margin: 15px 0 0 0;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.user-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
}

.header-logout-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1;
}

.header-logout-btn:hover {
    opacity: 0.85;
}

.user-role {
    font-size: 0.9em;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 30px auto;
    overflow: hidden;
    flex: 1;
}

footer {
    background: #000c13;
    color: #ffffff;
    text-align: center;
    padding: 20px 0;
    width: 100%;
    margin-top: auto;
}

.schedule {
    background: #e6e6e6;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.schedule h2 {
    margin-top: 0;
    color: #333;
}

/* View Tabs */
.view-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #222222;
    background: #222323;
    padding: 10px 15px;
    border-radius: 8px 8px 0 0;
}

.view-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    color: #fefefe;
    transition: all 0.3s;
}

.view-tab:hover {
    color: #f1f2f5;
}

.view-tab.active {
    color: #fefcfc;
    border-bottom-color: #ae0202;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.button {
    background: #5cb85c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    margin-right: 10px;
}

.button:hover {
    background: #4cae4c;
}

.button.secondary {
    background: #6c757d;
}

.button.secondary:hover {
    background: #5a6268;
}

.button.cancel {
    background: #ffc107;
    color: #333;
}

.button.cancel:hover {
    background: #e0a800;
    color: #333;
}

.button.mark-critical {
    background: #dc3545;
}

.button.mark-critical:hover {
    background: #c82333;
}

.button.delete-event {
    background: #667eea;
    padding: 8px 15px;
    font-size: 14px;
}

.button.delete-event:hover {
    background: #5568d3;
}

/* Create My Shift button: use same color as pulsating heart */
#schedule-button {
    background: #ab1b1b;
    color: white;
}

#schedule-button:hover {
    background: #ff5252;
}

/* Event Form Styles */
#event-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

#event-form input[type="text"],
#event-form input[type="date"],
#event-form input[type="time"] {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

#event-form input:focus {
    outline: none;
    border-color: #667eea;
}

/* Shift Selector Styles */
.shift-selector {
    margin: 20px 0;
}

.shift-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.shift-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.shift-option {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.shift-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.shift-option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.shift-option input[type="radio"]:checked + .shift-label {
    color: #667eea;
}

.shift-option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #f8f9ff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.shift-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.shift-label strong {
    font-size: 16px;
    color: #333;
}

.shift-label small {
    font-size: 13px;
    color: #666;
}

.shift-type-selector {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.shift-type-selector label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.shift-type-selector input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Date Mode Selector */
.date-selector {
    margin: 15px 0;
    display: flex;
    gap: 20px;
}

.date-selector label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.date-selector input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Multiple Date Section */
.date-range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
}

.date-range-inputs > div {
    display: flex;
    flex-direction: column;
}

.date-range-inputs label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.repeat-options {
    margin: 15px 0;
}

.repeat-options label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.repeat-options select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* Custom Days Selector */
#custom-days-selector {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

#custom-days-selector > label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.days-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.day-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.day-checkbox:hover {
    border-color: #667eea;
}

.day-checkbox input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

.day-checkbox:has(input[type="checkbox"]:checked) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Shift Count Preview */
.shift-count-preview {
    margin: 15px 0;
    padding: 12px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
}

.shift-count-preview p {
    margin: 0;
    font-size: 15px;
    color: #666;
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 20px;
}

.day-header {
    font-weight: bold;
    text-align: center;
    padding: 15px;
    /* Slightly lighter than the black header, matching the theme */
    background: linear-gradient(135deg, #222222 0%, #3a3a3a 100%);
    color: white;
    border-radius: 5px;
    font-size: 14px;
}

.day {
    border: 2px solid #e0e0e0;
    padding: 15px;
    min-height: 80px;
    cursor: pointer;
    position: relative;
    background: white;
    border-radius: 5px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.day:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.day.empty {
    background: #f9f9f9;
    cursor: default;
    border-color: transparent;
}

.day.empty:hover {
    transform: none;
    box-shadow: none;
}

.day.has-events {
    background: #e8f5e9;
    border-color: #5cb85c;
}

.day.today {
    background: #fff3cd;
    border-color: #ffc107;
    font-weight: bold;
}

.day-number {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.event-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #5cb85c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.event-count.warning {
    background: #ff6b6b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.day.at-limit {
    border: 2px solid #ff6b6b !important;
}

/* Event List Styles */
#event-list {
    margin-top: 40px;
}

#event-list h3 {
    color: #333;
    margin-bottom: 20px;
}

.event-list {
    list-style: none;
    padding: 0;
}

.event-item {
    background: #f8f9fa;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.event-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.event-title {
    font-size: 18px;
    color: #333;
}

.event-date {
    font-size: 14px;
    color: #666;
}

.event-datetime {
    font-size: 14px;
    color: #666;
}

.event-shift {
    font-size: 14px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
}

.event-shift.shift-day {
    background: #fff3cd;
    color: #856404;
}

.event-shift.shift-night {
    background: #d1ecf1;
    color: #000;
}

.event-item.shift-day {
    border-left-color: #ffc107;
}

.event-item.shift-night {
    border-left-color: #17a2b8;
}

.event-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.picked-up-badge {
    background: #28a745;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.release-shift {
    background: #ffc107;
    color: #333;
}

.release-shift:hover {
    background: #e0a800;
}

/* Open Shifts Section */
#open-shifts-section {
    margin: 40px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 2px dashed #667eea;
}

#open-shifts-section h3 {
    color: #667eea;
    margin-top: 0;
    font-size: 1.5em;
}

.open-shifts-list {
    list-style: none;
    padding: 0;
}

.open-shift-item {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.open-shift-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.open-shift-item.shift-day {
    border-left-color: #ffc107;
}

.open-shift-item.shift-night {
    border-left-color: #17a2b8;
}

.shift-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.shift-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.open-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.shift-title {
    font-size: 18px;
    color: #333;
}

.shift-date {
    font-size: 14px;
    color: #666;
}

.pick-up-shift {
    background: #667eea;
    white-space: nowrap;
}

.pick-up-shift:hover {
    background: #5568d3;
}

.no-events {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Authentication Styles */
.auth-container {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    background: #f8f9fa;
}

.auth-tab {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.auth-tab.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.auth-form {
    padding: 30px;
}

.auth-form h2 {
    margin-top: 0;
    color: #333;
    text-align: center;
}

.auth-form input,
.auth-form select {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: #667eea;
}

.auth-form .button {
    width: 100%;
    margin-top: 20px;
}

.auth-error {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    min-height: 20px;
}

/* User Profile Card */
.user-profile-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.user-profile-card h3 {
    margin-top: 0;
    color: #333;
}

.profile-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-item strong {
    color: #333;
    margin-right: 10px;
}

.profile-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.profile-buttons .button {
    flex: 1;
}

#logout-button {
    margin-top: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
    padding: 30px;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: scale(1.1);
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #666;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    background: transparent;
}

.close:hover,
.close:focus {
    color: #333;
    background: #f0f0f0;
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .button {
    margin: 0;
}

#logout-button {
    width: 100%;
    margin-top: 20px;
}

/* Team Calendar Styles */
#team-calendar-view h2 {
    color: #333;
    margin-bottom: 20px;
}

.team-filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.filter-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background: white;
}

.team-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 20px;

/* Hide the team calendar PTO list section (do not affect PTO tab) */
#team-pto-list-section {
    display: none !important;
}
}

.team-day {
    border: 2px solid #999;
    padding: 10px;
    min-height: 150px;
    background: white;
    border-radius: 5px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.team-day:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.team-day.empty {
    background: #f9f9f9;
    border-color: transparent;
}

.team-day.today {
    background: #fff3cd;
    border-color: #ffc107;
}

.team-day-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
}

.shift-count {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

.shift-count.day-count {
    background: #fff3cd;
    color: #856404;
}

.shift-count.night-count {
    background: #d1ecf1;
    color: #000;
}

.shift-count.open-count {
    background: #f8d7da;
    color: #721c24;
}

.team-staff-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    flex: 1;
    overflow-y: auto;
}

/* Team Calendar: OPEN slots where coverage is needed */
.team-open-day {
    background: #efc957;
    color: #333;
    padding: 2px 0;
    font-size: 12px;
    font-weight: 600;
}

.team-open-night {
    background: #e1bee7;
    color: #4a148c;
    padding: 2px 0;
    font-size: 12px;
    font-weight: 600;
}

/* PTO staff display */
.team-pto-staff {
    background: #f5f5f5;
    color: #9e9e9e;
    padding: 2px 4px;
    font-size: 11px;
    font-style: italic;
    border-radius: 3px;
    margin-top: 2px;
}

/* Drag and Drop styles */
.draggable-staff {
    border-radius: 3px;
    padding: 2px 4px !important;
    transition: all 0.2s ease;
    user-select: none;
}

.draggable-staff:hover {
    background: #e3f2fd;
    transform: scale(1.02);
}

.drop-zone.drag-over {
    background: #e8f5e9 !important;
    border-color: #4caf50 !important;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.staff-name-chip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#team-schedule-list {
    margin-top: 40px;
}

#team-schedule-list h3 {
    color: #333;
    margin-bottom: 20px;
}

.date-group {
    margin-bottom: 30px;
}

.date-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 18px;
}

.shifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.team-shift-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.team-shift-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.team-shift-card.shift-day {
    border-left-color: #ffc107;
}

.team-shift-card.shift-night {
    border-left-color: #17a2b8;
}

.shift-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.shift-time {
    font-weight: 600;
    font-size: 14px;
    color: #666;
}

.status-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
}

.status-badge.open-badge {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.assigned-badge {
    background: #d4edda;
    color: #155724;
}

.shift-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shift-card-body strong {
    font-size: 16px;
    color: #333;
}

.user-role-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.shift-time-range {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Subtle gray gradient border around non-calendar cards/placeholders */
.event-item,
.open-shift-item,
.team-shift-card,
.team-filters,
#team-schedule-list .date-group,
#open-shifts-section {
    position: relative;
    z-index: 0;
}

/* Removed gradient ring pseudo-elements to prevent overlay. If a
   gradient border is needed later, prefer border-image on the element
   itself to avoid covering content. */

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }
    
    header {
        flex-direction: column;
        padding: 15px;
        text-align: center;
    }
    
    .user-info {
        align-items: center;
        margin-top: 10px;
    }
    
    .schedule {
        padding: 15px;
    }
    
    .auth-container {
        margin: 20px;
    }
    
    .auth-form {
        padding: 20px;
    }
    
    .calendar-grid {
        gap: 4px;
    }
    
    .day {
        min-height: 60px;
        padding: 8px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .event-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .open-shift-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .event-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .button {
        width: 100%;
    }
    
    .date-range-inputs {
        grid-template-columns: 1fr;
    }
    
    .days-selector {
        justify-content: center;
    }
    
    .day-checkbox {
        flex: 1;
        min-width: 60px;
        justify-content: center;
    }
    
    .view-tabs {
        flex-direction: column;
    }
    
    .view-tab {
        text-align: center;
    }
    
    .team-filters {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .team-calendar-grid {
        gap: 4px;
    }
    
    .team-day {
        min-height: 80px;
        padding: 6px;
    }
    
    .staff-name-chip {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .team-staff-list {
        gap: 3px;
        margin-top: 5px;
    }
    
    .shifts-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .button {
        width: 100%;
    }
    
    .profile-buttons {
        flex-direction: column;
    }
    
    h1 {
        font-size: 1.5em;
    }
}

/* Work Preferences Styles */
.preference-selector {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.pref-select-btn {
    opacity: 0.6;
    transform: scale(0.95);
}

.pref-select-btn:hover {
    opacity: 0.8;
    transform: scale(0.98);
}

.pref-select-btn.active {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-width: 3px !important;
}

.preference-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: inline-block;
}

#preferences-calendar {
    margin: 20px 0;
}

#preferences-calendar .calendar-grid,
#preferences-calendar .team-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

#preferences-calendar .day {
    min-height: 80px;
    cursor: pointer;
    border: 2px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.2s;
    position: relative;
}

#preferences-calendar .day:hover:not(.empty) {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#preferences-calendar .day.empty {
    cursor: default;
    opacity: 0.3;
}

#preferences-calendar .day.pref-like {
    background: #4caf50 !important;
    color: white;
    border-color: #45a049;
}

#preferences-calendar .day.pref-clinic {
    background: #ffc107 !important;
    color: #333;
    border-color: #ffb300;
}

#preferences-calendar .day.pref-medical {
    background: #4169E1 !important;
    color: white;
    border-color: #2f55c7;
}

/* PTO Requests */
#pto-requests-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#pto-requests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.pto-request-item {
    background: #f8f9fa;
    border-left: 4px solid #fa709a;
    padding: 15px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pto-request-info {
    flex: 1;
}

.pto-request-dates {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.pto-request-reason {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.pto-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.pto-status-pending {
    background: #fff3cd;
    color: #856404;
}

.pto-status-approved {
    background: #d4edda;
    color: #155724;
}

.pto-status-denied {
    background: #f8d7da;
    color: #721c24;
}

.pto-no-requests {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Trade Requests */
#trade-requests-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#incoming-trade-requests,
#outgoing-trade-requests {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.trade-request-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.trade-request-info {
    flex: 1;
}

.trade-request-status {
    font-weight: 600;
    font-size: 0.9em;
}

.trade-status-pending { background: #fff3cd; color: #856404; padding: 6px 10px; border-radius: 12px; }
.trade-status-accepted { background: #d4edda; color: #155724; padding: 6px 10px; border-radius: 12px; }
.trade-status-denied { background: #f8d7da; color: #721c24; padding: 6px 10px; border-radius: 12px; }

.trade-actions { display: flex; gap: 8px; }
.trade-actions .button { padding: 6px 10px; font-size: 13px; }

#pto-modal .form-group {
    margin-bottom: 20px;
}

#pto-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

#pto-modal .form-group input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

/* Request Type Selector (styled radios) */
.request-type-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.request-type-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    transition: all 0.25s ease;
    font-weight: 600;
}

.request-type-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.request-type-option .option-label {
    flex: 1;
}

.request-type-option:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102,126,234,0.2);
}

.request-type-option:has(input[type="radio"]:checked) {
    background: #f8f9ff;
    border-color: #667eea;
}

.request-type-option.pto:has(input[type="radio"]:checked) .option-label { color: #4caf50; }
.request-type-option.education:has(input[type="radio"]:checked) .option-label { color: #8B4513; }
.request-type-option.medical:has(input[type="radio"]:checked) .option-label { color: #4169E1; }
.request-type-option.crossover:has(input[type="radio"]:checked) .option-label { color: #9c27b0; }

/* Desktop: show all request type options on a single row */
@media (min-width: 768px) {
    .request-type-group {
        grid-template-columns: repeat(4, 1fr);
    }
}

#preferences-calendar .day.pref-can {
    background: #ffc107 !important;
    color: #333;
    border-color: #ffb300;
}

#preferences-calendar .day.pref-rather-not {
    background: #f44336 !important;
    color: white;
    border-color: #da190b;
}

#preferences-calendar .day.pref-fourth-day {
    background: #ff9800 !important;
    color: white;
    border-color: #f57c00;
}

#preferences-calendar .day.pref-fourth-night {
    background: #311b92 !important;
    color: white;
    border-color: #38006b;
}

#preferences-calendar .day.pref-night-shift {
    background: #9c27b0 !important;
    color: white;
    border-color: #7b1fa2;
}

#preferences-calendar .day.pref-fourth-night {
    background: #311b92 !important;
    color: white;
    border-color: #38006b;
}

#preferences-calendar .day.pref-weekend {
    background: #00bcd4 !important;
    color: white;
    border-color: #0097a7;
}

#preferences-calendar .day-number {
    font-weight: bold;
    font-size: 18px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Keep Team Preferences actions visible while scrolling */
#team-preferences-modal .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: white;
    padding: 12px 0;
    margin-top: 16px;
    border-top: 1px solid #e0e0e0;
}

#team-preferences-modal .modal-content {
    /* Ensure the sticky action bar doesn't cover the bottom row content */
    padding-bottom: 96px;
}

/* Team Preferences View Styles */
.team-pref-day {
    /* Show all employees for the day (no internal cutoff); let the modal scroll */
    overflow: visible;
    max-height: none;
}

#team-preferences-calendar .day {
    min-height: 160px;
    padding: 8px;
    overflow: visible;
}

#team-preferences-calendar .calendar-grid {
    gap: 10px;
}
