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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #667eea;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #555;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="number"],
input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.player-entry {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.player-number {
    font-weight: 600;
    color: #667eea;
}

.remove-player-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.remove-player-btn:hover {
    background: #e84043;
}

.player-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #2ecc71;
    color: white;
    font-size: 1.1rem;
}

.btn-success:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

#addPlayerBtn {
    width: 100%;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.action-buttons .btn {
    flex: 1;
}

.help-text {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-status {
    color: #27ae60;
    font-weight: 600;
}

.results-subsection {
    margin-bottom: 30px;
}

.results-table {
    width: 100%;
    overflow-x: auto;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.results-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #667eea;
}

.results-table tr:hover {
    background: #f8f9fa;
}

.positive {
    color: #27ae60;
    font-weight: 600;
}

.negative {
    color: #e74c3c;
    font-weight: 600;
}

.settlements-list {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.settlement-item {
    padding: 12px;
    margin-bottom: 10px;
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    font-size: 1.05rem;
}

.settlement-item .amount {
    font-weight: 600;
    color: #27ae60;
}

.export-section {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    opacity: 0.8;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* History Tables */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.95rem;
}

.history-table th,
.history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    background-color: var(--card-bg);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.history-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.history-table .positive {
    color: var(--success-color);
    font-weight: 600;
}

.history-table .negative {
    color: var(--danger-color);
    font-weight: 600;
}

.history-table .total-row {
    font-weight: 700;
    background-color: rgba(0, 0, 0, 0.03);
}

.history-table .total-row td {
    border-top: 2px solid var(--border-color);
}

@media (max-width: 768px) {
    .form-row,
    .player-inputs {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

