* {
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 20px;
    color: #1e293b;
}
.container {
    max-width: 1600px;
    margin: 0 auto;
}
header {
    background: white;
    border-radius: 20px;
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
header h1 { margin: 0 0 6px 0; font-size: 1.8rem; }
header p { margin: 0; color: #5b6e8c; }

.config-bar, .toolbar {
    background: white;
    border-radius: 20px;
    padding: 12px 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.config-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-primary, .btn-secondary, .small-btn {
    border: none;
    border-radius: 40px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #e2e8f0; color: #1e293b; }
.btn-secondary:hover { background: #cbd5e1; }
.small-btn {
    background: #f1f5f9;
    font-size: 0.8rem;
    padding: 4px 12px;
    margin-top: 8px;
}

.data-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
.data-tables .table-card:last-child {
    min-width: 1200px;
}
.table-card {
    background: white;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.table-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.2rem;
}
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.table-wrapper {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 8px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
th {
    background: #f8fafc;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
td {
    padding: 8px;
    border-bottom: 1px solid #f0f2f5;
}
.edit-btn, .delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
}
.edit-btn { color: #3b82f6; background: #eff6ff; }
.delete-btn { color: #ef4444; background: #fef2f2; }

.control-bar {
    background: white;
    border-radius: 20px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.rule-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.result-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.result-section h3 {
    margin: 16px 0 12px 0;
}
.gantt-container {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 20px;
    background: white;
    min-height: 450px;
    width: 100%;
    position: relative;
}
canvas {
    display: block;
    width: 100%;
    height: auto;
}
.task-gantt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin: 16px 0 8px;
}
.sort-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}
.sort-btn {
    background: #f1f5f9;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
}
.sort-btn:hover {
    background: #e2e8f0;
}

.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.fullscreen-modal canvas {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}