* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar h1 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

nav ul {
    list-style: none;
}

nav ul li {
    margin-bottom: 0.5rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 0.75rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

nav ul li.active a {
    background-color: #3498db;
}

.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.stats-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stats-toolbar .action-btn {
    background-color: #27ae60;
}

.stats-toolbar .action-btn:hover {
    background-color: #219a52;
}

#save-status {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #7f8c8d;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
}

.toggle-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
    margin-left: 0.5rem;
}

.account-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.account-form h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    margin-right: 1rem;
}

.form-group:last-child {
    margin-right: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.submit-btn {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    margin-top: 1rem;
}

.submit-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
}

.account-list {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-container {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.filter-container h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #555;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-group input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 120px;
}

.filter-btn {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filter-btn:hover {
    background-color: #2980b9;
}

.chart-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.chart-container h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.income-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.income-form h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.income-chart {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.income-chart h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.chart-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-btn {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.chart-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.income-list {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.income-list h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

#income-table {
    width: 100%;
    border-collapse: collapse;
}

#income-table th,
#income-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#income-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

#income-table tr:hover {
    background-color: #f8f9fa;
}

.account-list h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

#account-table {
    width: 100%;
    border-collapse: collapse;
}

#account-table th,
#account-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#account-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

#account-table tr:hover {
    background-color: #f8f9fa;
}

.action-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 0.5rem;
}

.action-btn:hover {
    background-color: #229954;
}

.action-btn.delete-btn {
    background-color: #e74c3c;
}

.account-code-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.copy-icon {
    font-size: 1rem;
}

.copy-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #27ae60;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.action-btn.delete-btn:hover {
    background-color: #c0392b;
}

.order-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.order-form h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.order-list {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.order-list h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

#order-table {
    width: 100%;
    border-collapse: collapse;
}

#order-table th,
#order-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#order-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

#order-table tr:hover {
    background-color: #f8f9fa;
}

.calculator-rules {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.calc-records-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.calc-records-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.records-list {
    max-height: 300px;
    overflow-y: auto;
}

.record-item {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.record-type {
    font-weight: bold;
    color: #3498db;
}

.record-date {
    font-size: 0.85rem;
    color: #666;
}

.record-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    font-size: 0.9rem;
}

.record-item label {
    color: #666;
}

.calculator-rules h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.rule-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.rule-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.rule-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #555;
}

.rule-item ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    color: #666;
}

.rule-item li {
    margin-bottom: 0.25rem;
}

.calculator-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.calculator-form h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.calculator-result {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calculator-result h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.result-card {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
}

.result-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #555;
}

.result-card p {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3498db;
}

.account-results {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.account-result-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-result-item:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.account-result-item p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.account-result-item .account-code {
    font-weight: bold;
    color: #2c3e50;
}

.account-result-item .account-info {
    color: #6c757d;
    font-size: 0.85rem;
}

#order-table {
    width: 100%;
    border-collapse: collapse;
}

#order-table th,
#order-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#order-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

#order-table tr:hover {
    background-color: #f8f9fa;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
    }
    
    .sidebar nav ul {
        display: flex;
        justify-content: space-around;
    }
    
    .sidebar nav ul li {
        margin-bottom: 0;
    }
    
    .content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .form-group:last-child {
        margin-bottom: 0;
    }
    
    #account-table {
        font-size: 0.875rem;
    }
    
    #account-table th,
    #account-table td {
        padding: 0.5rem;
    }
}