body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

h1 {
    text-align: center;
    font-size: 2.5em;
    font-weight: 700;
}

h2 {
    font-size: 1.8em;
    font-weight: 600;
}

h3 {
    font-size: 1.4em;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
}

.btn:last-child {
    margin-right: 0;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-info {
    background-color: #f39c12; /* Changed from #3498db to a distinct color */
    color: white;
}

.btn-info:hover {
    background-color: #e67e22;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-warning {
    background-color: #e67e22; /* More prominent for delete */
    color: white;
}

.btn-warning:hover {
    background-color: #d35400;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.btn-secondary {
    background-color: #bdc3c7;
    color: #2c3e50;
}

.btn-secondary:hover {
    background-color: #95a5a6;
    box-shadow: 0 4px 12px rgba(189, 195, 199, 0.3);
}

/* Search Bar */
.search-bar {
    margin-bottom: 25px;
    padding: 10px;
    background-color: #ecf0f1;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

#user-search {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
}

#user-search:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* User List */
#users-container {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.user-list-header, .user-list-item {
    display: grid;
    grid-template-columns: 80px 1.5fr 1fr 2fr 100px 150px; /* Adjust column widths as needed */
    padding: 12px 15px;
    align-items: center;
    gap: 10px;
}

.user-list-header {
    background-color: #34495e;
    color: white;
    font-weight: 700;
    border-bottom: 1px solid #2c3e50;
    text-transform: uppercase;
    font-size: 0.85em;
}

.user-list-item {
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    font-size: 0.9em;
}

.user-list-item:hover {
    background-color: #f8f8f8;
}

.user-list-item:last-child {
    border-bottom: none;
}

.user-list-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-status.active { color: #27ae60; font-weight: 600; }
.user-status.dormant { color: #f39c12; font-weight: 600; }
.user-status.suspended { color: #e74c3c; font-weight: 600; }

/* User Detail Section */
#user-detail-section {
    padding-top: 20px;
}

#back-to-list-btn {
    margin-bottom: 20px;
}

.detail-card {
    background-color: #fdfdfd;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.profile-image-container {
    text-align: center;
    margin-bottom: 25px;
}

#detail-profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #3498db;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px 25px;
    margin-bottom: 25px;
}

.detail-item {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.95em;
}

.detail-item strong {
    color: #555;
    min-width: 120px; /* Aligns labels better */
    display: inline-block;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #ecf0f1;
    border-radius: 10px;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.08);
}

.action-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-actions input[type="number"],
.admin-actions select {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.9em;
    min-width: 120px;
}

.admin-actions input[type="number"]:focus,
.admin-actions select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}


/* History Table */
.history-table {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.history-header, .history-item {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1.2fr 1.5fr 0.8fr 1fr; /* Adjust column widths */
    padding: 12px 15px;
    align-items: center;
    gap: 10px;
}

.history-header {
    background-color: #4CAF50; /* A distinct green for history header */
    color: white;
    font-weight: 700;
    border-bottom: 1px solid #388E3C;
    text-transform: uppercase;
    font-size: 0.8em;
}

.history-item {
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    font-size: 0.85em;
}

.history-item:nth-child(even) {
    background-color: #f9f9f9;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item .status-pending { color: #f39c12; font-weight: 500; }
.history-item .status-completed { color: #27ae60; font-weight: 500; }
.history-item .status-failed { color: #e74c3c; font-weight: 500; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .user-list-header, .user-list-item,
    .history-header, .history-item {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* More flexible on small screens */
        font-size: 0.8em;
    }

    .user-list-item img {
        width: 40px;
        height: 40px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .btn {
        width: 100%;
        margin-right: 0;
    }

    .admin-actions input[type="number"],
    .admin-actions select {
        width: 100%;
        box-sizing: border-box;
    }
}