/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: #2c3e50;
    color: #fff;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header h1 {
    font-size: 1.5rem;
}

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

.nav a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav a:hover,
.nav a.active {
    background: #34495e;
}

/* Main Content */
.main {
    background: #fff;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Forms */
.form {
    margin-bottom: 25px;
}

.form-inline {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.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);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.875rem;
}

.form-inline .form-group {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

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

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

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.alert ul {
    margin-left: 20px;
    margin-top: 10px;
}

.alert details {
    margin-top: 10px;
}

.alert summary {
    cursor: pointer;
    color: #666;
}

/* View Tabs */
.view-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.view-tabs .tab {
    padding: 12px 24px;
    text-decoration: none;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
    transition: all 0.2s;
}

.view-tabs .tab:hover {
    background: #e8e8e8;
    color: #333;
}

.view-tabs .tab.active {
    background: #fff;
    color: #3498db;
    font-weight: 600;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

/* Info Box */
.info-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.info-box ul {
    margin-left: 20px;
}

/* Help Box */
.help-box {
    background: #fafafa;
    padding: 20px;
    border-radius: 4px;
    margin-top: 30px;
    border: 1px solid #eee;
}

/* Danger Zone */
.danger-zone {
    background: #fff5f5;
    padding: 20px;
    border-radius: 4px;
    margin-top: 30px;
    border: 1px solid #e74c3c;
}

.danger-zone h3 {
    color: #c0392b;
    margin-bottom: 10px;
}

.danger-zone p {
    color: #666;
    margin-bottom: 15px;
}

.help-box h3 {
    margin-bottom: 15px;
    color: #555;
}

.help-box h4 {
    margin: 15px 0 5px 0;
    color: #666;
}

.help-box p {
    font-family: monospace;
    font-size: 0.875rem;
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table th,
.data-table td {
    padding: 5px 5px;
    font-size: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 300;
    color: #555;
    position: sticky;
    top: 0;
}

.data-table tbody tr:hover {
    background: #f5f5f5;
}

.data-table .num {
    text-align: right;
    font-family: monospace;
}

.data-table .num.highlight {
    background: #fff3e0;
    color: #e65100;
    font-weight: 600;
}

/* Result Header */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #3498db;
    font-size: 1.2rem;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.month-list {
    list-style: none;
}

.month-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.month-list li:last-child {
    border-bottom: none;
}

.month-list a:not(.btn) {
    color: #3498db;
    text-decoration: none;
}

.month-list a:not(.btn):hover {
    text-decoration: underline;
}

.no-data {
    color: #888;
    font-style: italic;
}

.guide-list {
    margin-left: 20px;
}

.guide-list li {
    margin-bottom: 10px;
}

/* Footer */
.footer {
    margin-top: 30px;
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.875rem;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    background: #fff;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

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

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline .form-group {
        width: 100%;
    }

    .result-header {
        flex-direction: column;
        gap: 10px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
