* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

h2 {
    margin-bottom: 15px;
    color: #34495e;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

section {
    background: white;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.add-person {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.role-management {
    background: white;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.role-controls {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.role-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.role-group label {
    font-weight: bold;
    min-width: 120px;
    text-align: left;
}

.role-group button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-group span {
    font-size: 18px;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}

.staffing-status {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 10px;
}

.staffing-status.adequate {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.staffing-status.shortage {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.rotation-info {
    background-color: #e2e3e5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #6c757d;
}

.rotation-info p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

.add-person select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input[type="text"], input[type="date"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.export-btn {
    background-color: #27ae60 !important;
    color: white;
    font-weight: bold;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background-color: #219a52 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.export-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.people-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.person-tag {
    background-color: #ecf0f1;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.remove-person {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roster-controls {
    text-align: center;
}

.roster-controls button {
    margin: 0 10px;
}

.date-selection {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.date-selection label {
    font-weight: bold;
}

.assignment-mode {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.person-selection {
    display: flex;
    align-items: center;
    gap: 10px;
}

.person-selection label {
    font-weight: bold;
}

.person-selection select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.mode-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-btn {
    padding: 10px 15px;
    margin: 5px;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s;
}

.mode-btn.active {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.mode-btn:nth-child(1) { background-color: #e74c3c; }
.mode-btn:nth-child(1):hover { background-color: #c0392b; }
.mode-btn:nth-child(1).active { background-color: #c0392b; }

.mode-btn:nth-child(2) { background-color: #f39c12; }
.mode-btn:nth-child(2):hover { background-color: #e67e22; }
.mode-btn:nth-child(2).active { background-color: #e67e22; }

.mode-btn:nth-child(3) { background-color: #95a5a6; }
.mode-btn:nth-child(3):hover { background-color: #7f8c8d; }
.mode-btn:nth-child(3).active { background-color: #7f8c8d; }

.current-mode {
    font-style: italic;
    color: #7f8c8d;
    text-align: center;
    max-width: 600px;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
    border: 2px solid #3498db;
    border-radius: 8px;
}

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

.roster-table th,
.roster-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
    height: 40px;
}

.roster-table th {
    background-color: #3498db;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.roster-table .role-header {
    background-color: #34495e;
    color: white;
    font-weight: bold;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    width: 80px;
    position: sticky;
    left: 0;
    z-index: 11;
}

.roster-table .ward-row { background-color: #e8f5e8; }
.roster-table .idcp-row { background-color: #e8f0ff; }
.roster-table .float-row { background-color: #fff3e0; }
.roster-table .off-row { background-color: #ffebee; }
.roster-table .custom-row { background-color: #f8f9fa; }

.roster-table .block-header {
    background-color: #3498db;
    color: white;
    font-size: 10px;
    writing-mode: horizontal-tb;
    width: 50px;
}

.roster-table .clickable-header {
    cursor: pointer;
    transition: background-color 0.2s;
}

.roster-table .clickable-header:hover {
    background-color: #2980b9;
}

.person-cell {
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.person-cell:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.person-cell.off-request {
    background-color: #e74c3c;
    color: white;
    border-radius: 4px;
}

.person-cell.work-request {
    background-color: #f39c12;
    color: white;
    border-radius: 4px;
}

.block-date {
    font-size: 9px;
    color: #2c3e50;
    font-weight: bold;
    display: block;
    margin-top: 3px;
    text-shadow: 0 0 1px rgba(255,255,255,0.8);
}

.person-tag {
    background-color: #ecf0f1;
    padding: 6px 10px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px;
    font-size: 12px;
}

.person-tag.ward { background-color: #e8f5e8; }
.person-tag.idcp { background-color: #e8f0ff; }
.person-tag.float { background-color: #fff3e0; }
.person-tag.leave { background-color: #ffebee; }


/* Statistics Styles */
.statistics-section {
    background: white;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.statistics-container {
    margin-top: 15px;
}

.statistics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.statistics-table th,
.statistics-table td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.statistics-table th {
    background-color: #3498db;
    color: white;
    font-weight: bold;
}

.statistics-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.statistics-table tr:hover {
    background-color: #f5f5f5;
}

.stat-ward {
    background-color: #e8f5e8 !important;
    font-weight: bold;
}

.stat-idcp {
    background-color: #e8f0ff !important;
    font-weight: bold;
}

.stat-float {
    background-color: #fff0e8 !important;
    font-weight: bold;
}

.stat-leave {
    background-color: #fff8e1 !important;
    font-weight: bold;
}

.balance-balanced {
    background-color: #d4edda !important;
    color: #155724;
    font-weight: bold;
}

.balance-fair {
    background-color: #fff3cd !important;
    color: #856404;
    font-weight: bold;
}

.balance-unbalanced {
    background-color: #f8d7da !important;
    color: #721c24;
    font-weight: bold;
}

/* Footer Styles */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
    border-top: 3px solid #3498db;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    margin: 0;
    font-size: 14px;
    color: #ecf0f1;
}

.footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #5dade2;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .request-form {
        flex-direction: column;
    }
    
    .roster-table {
        font-size: 10px;
    }
    
    .roster-table th,
    .roster-table td {
        padding: 4px;
        height: 35px;
    }
    
    .statistics-table {
        font-size: 12px;
    }
    
    .statistics-table th,
    .statistics-table td {
        padding: 6px 8px;
    }
    
    .footer {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .footer p {
        font-size: 12px;
    }
}