/* General Body Styles */
body {
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left h1 {
    margin: 0;
    font-size: 1.5em;
    margin-left: 15px;
}

.header-right span {
    margin-right: 20px;
    font-size: 0.9em;
}

.action-button {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9em;
}

.action-button.primary {
    background-color: #3498db;
    color: white;
}

.action-button.primary:hover {
    background-color: #2980b9;
}

.action-button.secondary {
    background-color: #ecf0f1;
    color: #34495e;
    border: 1px solid #bdc3c7;
}

.action-button.secondary:hover {
    background-color: #bdc3c7;
}

/* Hamburger Menu for Mobile */
.hamburger {
    background: none;
    border: none;
    color: #ecf0f1;
    font-size: 1.8em;
    cursor: pointer;
    display: none; /* Hidden by default, shown on mobile */
}

.mobile-menu {
    display: none; /* Hidden by default */
    background-color: #34495e;
    position: absolute;
    top: 60px; /* Adjust based on header height */
    left: 0;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 999;
    flex-direction: column;
    padding: 10px 0;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: #ecf0f1;
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
}

.mobile-menu a:hover {
    background-color: #2c3e50;
}

/* Main Content Area */
main {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.card-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.section-header h2 {
    margin: 0;
    color: #2c3e50;
}

/* Search Form */
.search-form {
    display: flex;
    margin-bottom: 20px;
}

.search-form input[type="search"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
    font-size: 1em;
}

.search-form button {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #2980b9;
}

/* Customer Cards */
.customer-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.customer-card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.customer-card:hover {
    transform: translateY(-5px);
}

.customer-card h3 {
    margin-top: 0;
    color: #34495e;
    font-size: 1.2em;
}

.customer-card p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #555;
}

.customer-card .view-detail-button {
    background-color: #2ecc71;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85em;
    margin-top: 10px;
    display: inline-block;
}

.customer-card .view-detail-button:hover {
    background-color: #27ae60;
}

.customer-card .edit-button {
    background-color: #f39c12;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85em;
    margin-top: 10px;
    display: inline-block;
    margin-left: 10px;
}

.customer-card .edit-button:hover {
    background-color: #e67e22;
}

.no-results {
    text-align: center;
    color: #777;
    grid-column: 1 / -1; /* Span across all columns */
    padding: 30px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background-color: #f0f0f0;
}

/* Forms (Add Customer, Correspondence) */
.customer-form, .correspondence-form {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #34495e;
}

.form-group label span {
    color: #e74c3c;
    font-size: 0.8em;
    margin-left: 5px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: calc(100% - 22px); /* Adjust for padding and border */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Customer Detail Section */
.customer-detail-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.detail-item {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dashed #eee;
}

.detail-item strong {
    color: #34495e;
}

.correspondence-list {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.correspondence-item {
    background-color: #f0f8ff;
    border: 1px solid #e0f0ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.correspondence-item strong {
    color: #2c3e50;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 0.85em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .desktop-menu {
        display: none;
    }

    .hamburger {
        display: block;
    }

    header {
        padding: 10px 15px;
    }

    .header-left h1 {
        font-size: 1.3em;
        margin-left: 10px;
    }

    main {
        padding: 15px;
        margin: 15px auto;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header h2 {
        margin-bottom: 10px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form input[type="search"] {
        border-radius: 5px;
        margin-bottom: 10px;
    }

    .search-form button {
        border-radius: 5px;
        width: 100%;
    }

    .customer-cards {
        grid-template-columns: 1fr;
    }
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 5px;
    width: auto; /* Override default form input width */
}

.checkbox-group label {
    display: inline-block;
    margin-bottom: 0;
    font-weight: normal;
    color: #333;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more specific */
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Login Page Specific Styles */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f7f6;
    font-family: 'Noto Sans JP', sans-serif;
}
.login-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-container h2 {
    margin-bottom: 30px;
    color: #333;
}
.login-container .form-group {
    margin-bottom: 20px;
    text-align: left;
}
.login-container .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}
.login-container .form-group input[type="text"],
.login-container .form-group input[type="password"] {
    width: calc(100% - 20px);
    padding: 12px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}
.login-container .action-button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.login-container .action-button:hover {
    background-color: #0056b3;
}
.login-container .error-message {
    color: #dc3545;
    margin-top: 15px;
    font-weight: bold;
}

/* User Management Page Specific Styles */
.user-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.user-list-table th, .user-list-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}
.user-list-table th {
    background-color: #f2f2f2;
}
.user-list-table .delete-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.user-list-table .delete-button:hover {
    background-color: #c82333;
}
.user-management-section .message {
    color: #28a745;
    font-weight: bold;
    margin-bottom: 15px;
}
.user-management-section .error-message {
    color: #dc3545;
    font-weight: bold;
    margin-bottom: 15px;
}
.user-management-section .form-group {
    margin-bottom: 15px;
}
.user-management-section .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.user-management-section .form-group input[type="text"],
.user-management-section .form-group input[type="password"] {
    width: calc(100% - 22px);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.user-management-section .action-button.primary {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.user-management-section .action-button.primary:hover {
    background-color: #0056b3;
}

/* Isolate login page from main styles */
body.login-page main {
    max-width: none;
    margin: 0;
    padding: 0;
    background-color: transparent;
    box-shadow: none;
}

body.login-page header {
    display: none;
}

/* Specific styles for user management page */
.user-management-section {
    max-width: 800px;
    margin: 0 auto;
}

.work-report-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.work-report-item-link:hover .work-report-item {
    background-color: #f9f9f9;
}