body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #004080;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

h1 {
    color: #004080;
    margin: 0;
    font-size: 22px;
}

h2 {
    color: #555;
    text-align: center;
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 25px;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
}

.alert-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.settings-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 18px;
    border-radius: 8px;
}

.settings-box h3 {
    margin-top: 0;
    color: #004080;
    font-size: 15px;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 6px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #475569;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    box-sizing: border-box;
    background: #fff;
}

.btn-admin {
    background: #004080;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    margin-top: 4px;
}

.btn-success {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    width: 100%;
    margin-top: 10px;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}

.btn-logout {
    background: #64748b;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.card {
    background: #eef2f7;
    border-left: 4px solid #004080;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.card h4 {
    margin: 0 0 4px 0;
    font-size: 10.5px;
    color: #666;
    text-transform: uppercase;
}

.card .number {
    font-size: 18px;
    font-weight: bold;
    color: #004080;
}

.master-tab-menu {
    display: flex;
    gap: 8px;
    border-bottom: 3px solid #004080;
    margin-bottom: 25px;
}

.master-tab-btn {
    background: #e2e8f0;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    color: #334155;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}

.master-tab-btn.active {
    background: #004080;
    color: white;
}

.master-section {
    display: none;
}

.master-section.active {
    display: block;
}

.sub-tab-menu {
    display: flex;
    border-bottom: 2px solid #004080;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 4px;
}

.sub-tab-btn {
    background: #eef2f7;
    border: none;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    color: #004080;
    border-radius: 6px 6px 0 0;
}

.sub-tab-btn.active {
    background: #004080;
    color: white;
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 20px;
}

th,
td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-size: 13px;
}

th {
    background-color: #004080;
    color: white;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

.badge-yes {
    background-color: #d4edda;
    color: #155724;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
}

.badge-no {
    background-color: #e2e3e5;
    color: #383d41;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.badge-due {
    background-color: #f8d7da;
    color: #842029;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11.5px;
    border: 1px solid #f5c2c7;
    display: inline-block;
}

.badge-ok {
    background-color: #d1e7dd;
    color: #0f5132;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11.5px;
}

.manual-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.team-link-row {
    cursor: pointer;
    color: #004080;
    font-weight: bold;
}

.team-link-row:hover {
    background-color: #e0f2fe !important;
    text-decoration: underline;
}

.team-name-cell {
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.modal-card h3 {
    margin-top: 0;
    color: #004080;
    font-size: 18px;
    border-bottom: 2px solid #004080;
    padding-bottom: 8px;
}

.summary-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.summary-detail-row span:first-child {
    color: #64748b;
    font-weight: 600;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .master-tab-btn:not(:first-child) {
        display: none !important;
    }
}

/* Modal Overlay Styling */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-box {
    background: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    animation: modalPop 0.3s ease-out;
}
@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.modal-icon {
    font-size: 42px;
    color: #28a745;
    margin-bottom: 10px;
}
.modal-box h3 {
    margin-top: 0;
    color: #004080;
    border: none;
    padding: 0;
}
.modal-box p {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
}
.modal-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}
.modal-btn:hover { background-color: #218838; }